This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[COMMIT] Accept "\r\n" line-endings on all hosts


In the discussion about elimination of the Cygwin and DJGPP xm.h files
we seemed to have reached agreement on this.  Actually this is a real
improvement, since it will allow you to execute scripts copied from a
system using the MS-DOS convention without converting them.

Tested on i386-unknown-freebsd4.7.

Mark

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* top.c (gdb_readline): Always accept "\r\n" as a line-ending.
	* event-top.c (gdb_readline2): Likewise.

Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.93
diff -u -p -r1.93 top.c
--- top.c 13 Sep 2004 18:26:30 -0000 1.93
+++ top.c 14 Oct 2004 12:30:25 -0000
@@ -932,15 +932,11 @@ gdb_readline (char *prompt_arg)
 	}
 
       if (c == '\n')
-#ifndef CRLF_SOURCE_FILES
-	break;
-#else
 	{
 	  if (input_index > 0 && result[input_index - 1] == '\r')
 	    input_index--;
 	  break;
 	}
-#endif
 
       result[input_index++] = c;
       while (input_index >= result_size)
Index: event-top.c
===================================================================
RCS file: /cvs/src/src/gdb/event-top.c,v
retrieving revision 1.34
diff -u -p -r1.34 event-top.c
--- event-top.c 13 Sep 2004 18:26:28 -0000 1.34
+++ event-top.c 14 Oct 2004 12:30:27 -0000
@@ -855,15 +855,11 @@ gdb_readline2 (gdb_client_data client_da
 	}
 
       if (c == '\n')
-#ifndef CRLF_SOURCE_FILES
-	break;
-#else
 	{
 	  if (input_index > 0 && result[input_index - 1] == '\r')
 	    input_index--;
 	  break;
 	}
-#endif
 
       result[input_index++] = c;
       while (input_index >= result_size)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]