After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 300204 - [PATCH] Doxygen disobeys Cygwin 'text/binary mount mode'
[PATCH] Doxygen disobeys Cygwin 'text/binary mount mode'
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.4.x
Other other
: High minor
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2005-04-11 15:24 UTC by Max Bowsher
Modified: 2005-05-16 19:34 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Max Bowsher 2005-04-11 15:24:12 UTC
Cygwin has a per path setting that controls whether text files default to
behaving in a unix-like (LF) or a DOS-like (CRLF) way.

Explicitly passing a text-mode open flag to open() or fopen() forces the issue,
but most Cygwin users will expect and prefer the default to be followed.

Here is a patch that corrects the issue:

Index: qtools/qfile_unix.cpp
===================================================================
RCS file: /u/kp3softd/cvsroot/qtools/qfile_unix.cpp,v
retrieving revision 1.8
diff -u -p -r1.8 qfile_unix.cpp
--- qtools/qfile_unix.cpp	3 Nov 2003 18:04:42 -0000	1.8
+++ qtools/qfile_unix.cpp	11 Apr 2005 15:20:00 -0000
@@ -175,7 +175,11 @@ bool QFile::open( int m )
 	}
 #if defined(HAS_TEXT_FILEMODE)
 	if ( isTranslated() )
+#ifdef __CYGWIN__
+	    /* Do nothing, allowing the Cygwin mount mode to take effect. */;
+#else
 	    oflags |= OPEN_TEXT;
+#endif
 	else
 	    oflags |= OPEN_BINARY;
 #endif
@@ -214,7 +218,11 @@ bool QFile::open( int m )
 	qstrcpy( perm2, perm );
 #if defined(HAS_TEXT_FILEMODE)
 	if ( isTranslated() )
+#ifdef __CYGWIN__
+	    /* Do nothing, allowing the Cygwin mount mode to take effect. */;
+#else
 	    strcat( perm2, "t" );
+#endif
 	else
 	    strcat( perm2, "b" );
 #endif
Comment 1 Christian Kirbach 2005-04-12 09:57:52 UTC
Raising priority to make maintainers aware of patch.
Comment 2 Dhwdev 2005-04-12 22:42:20 UTC
This fixed my problem with Cygwin. Thanks, Max!
Comment 3 Max Bowsher 2005-04-12 23:02:35 UTC
This of course works on the basis that Cygwin is a Unixy environment. (I
configure using platform linux-g++ on Cygwin).

I am aware that there appear to be stale remnants of a win32-g++ platform
targeting Cygwin, but this I believe to be the wrong approach, since the
environment Cygwin exposes to programs is far more like Linux than like Windows.
Comment 4 Dhwdev 2005-04-13 00:43:45 UTC
This is good to know. If linux-g++ fixes the problem then only the docs and/or 
the configure script needs to be changed to indicate this. I agree that the 
patch is not necessary assuming the linux-g++ works ( I haven't verified the 
linux-g++ works ).
Comment 5 Max Bowsher 2005-04-13 10:28:29 UTC
No, you've got it all backwards.

This patch will have absolutely no effect if doxygen is being compiled with a
win32 platform ID, because the file it touches will be completely ignored.

I am pointing out I compile and happily use Doxygen using the linux-g++ platform
ID on Cygwin, despite the fact that there is some kind of (possibly stale)
Cygwin configuration in the win32-g++ platform ID.
Comment 6 Dimitri van Heesch 2005-04-16 13:25:50 UTC
Thanks, I'll include the patch in the next CVS update.
Comment 7 Dimitri van Heesch 2005-05-16 16:30:16 UTC
This should now be fixed in release 1.4.3. Please verify.
Comment 8 Max Bowsher 2005-05-16 19:34:20 UTC
Confirmed fixed.