This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch-readline] history file generation on minGW host
- From: Denis PILAT <denis dot pilat at st dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 16 Mar 2006 14:44:38 +0100
- Subject: [patch-readline] history file generation on minGW host
On minGW host, history file are open in text mode, that's imply windows
specific
carriage return to be inserted ( \n -> \r\n conversion performed) and
prevents windows history file to be compliant with linux one's.
When using current history file for windows, "^M" appears at each end of
line.
This patch fixes this problem.
--
Denis
Index: readline/histfile.c
===================================================================
--- readline/histfile.c (revision 368)
+++ readline/histfile.c (working copy)
@@ -70,17 +70,18 @@
#endif /* HAVE_MMAP */
/* If we're compiling for __EMX__ (OS/2) or __CYGWIN__ (cygwin32 environment
- on win 95/98/nt), we want to open files with O_BINARY mode so that there
+ on win 95/98/nt) or __MINGW32__ (pure windows environment),
+ we want to open files with O_BINARY mode so that there
is no \n -> \r\n conversion performed. On other systems, we don't want to
mess around with O_BINARY at all, so we ensure that it's defined to 0. */
-#if defined (__EMX__) || defined (__CYGWIN__)
+#if defined (__EMX__) || defined (__CYGWIN__) || defined (__MINGW32__)
# ifndef O_BINARY
# define O_BINARY 0
# endif
-#else /* !__EMX__ && !__CYGWIN__ */
+#else /* !__EMX__ && !__CYGWIN__ && !__MINGW32__ */
# undef O_BINARY
# define O_BINARY 0
-#endif /* !__EMX__ && !__CYGWIN__ */
+#endif /* !__EMX__ && !__CYGWIN__ && !__MINGW32__ */
#include <errno.h>
#if !defined (errno)
2006-03-16 Denis Pilat <denis.pilat@st.com>
* histfile.c (O_BINARY): Avoid \n -> \r\n conversion
for minGW host.