Comment 4 for bug 1685091

Revision history for this message
Patrick Storz (ede123) wrote :

The issue arises because MSYS2 uses a patched version of glib's stdio.c (see [1]) that obviously chokes on the duplicated 'b' modifier. (For the background of this patch see [2]).

As the duplication of 'b' certainly does not seem to be standard conforming (see [3,4]) that code should be fixed and we're certainly lucky Microsoft's implementation of fopen() was lenient enough not to fail before.

A general thing I noticed: Why do we use separate code paths in fopen_utf8name() to start with? Calling g_filename_from_utf8() followed by g_open() should work across all OSs.

[1] https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-glib2/0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch
[2] https://bugzilla.gnome.org/show_bug.cgi?id=674214
[3] http://pubs.opengroup.org/onlinepubs/009695399/functions/fopen.html
[4] https://msdn.microsoft.com/library/yeby3zcb.aspx