summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1999-03-31 23:25:13 +0000
committerPaul Smith <psmith@gnu.org>1999-03-31 23:25:13 +0000
commit7052a5715236b84ebe0b3011c4de75ce19c4ab5d (patch)
tree5b401afcb479f81fee107132c12ef745991f6579
parent47922a5a659bfe49976bae8f9ce1e11a23006d29 (diff)
downloadgunmake-7052a5715236b84ebe0b3011c4de75ce19c4ab5d.tar.gz
* Ignore CR in CRLF line terminators for compatibility with DOSsy
makefiles.
-rw-r--r--ChangeLog5
-rw-r--r--NEWS9
-rw-r--r--read.c11
3 files changed, 20 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index b7b1b85..aeba342 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+1999-03-31 Paul D. Smith <psmith@gnu.org>
+
+ * read.c (readline): Ignore carriage returns at the end of the
+ line, to allow Windows-y CRLF line terminators.
+
1999-03-30 Paul D. Smith <psmith@gnu.org>
* configure.in: Don't put build.sh here, since build.sh.in doesn't
diff --git a/NEWS b/NEWS
index c7044b6..4b6978f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
GNU make NEWS -*-indented-text-*-
History of user-visible changes.
- 22 Mar 1999
+ 31 Mar 1999
Copyright (C) 1992,93,94,95,96,97,98,1999 Free Software Foundation, Inc.
See the end for copying conditions.
@@ -21,6 +21,9 @@ Version 3.78
* Make defines a new variable, .LIBPATTERNS. This variable controls how
the link library dependency expansion (dependencies like ``-lfoo'') is
performed.
+
+* Make allows CRLF sequences as well as traditional LF, in makefiles for
+ UNIX.
Version 3.77
@@ -682,7 +685,3 @@ Copyright information:
Permission is granted to distribute modified versions of this
document, or of portions of it, under the above conditions, provided
also that they carry prominent notices stating who last changed them.
-
-Local variables:
-version-control: never
-end:
diff --git a/read.c b/read.c
index 1ce892d..1b340ac 100644
--- a/read.c
+++ b/read.c
@@ -2129,6 +2129,17 @@ readline (linebuffer, stream, flocp)
++nlines;
+#if !defined(WINDOWS32) && !defined(__MSDOS__)
+ /* Check to see if the line was really ended with CRLF; if so ignore
+ the CR. */
+ if (len > 1 && p[-2] == '\r')
+ {
+ --len;
+ --p;
+ p[-1] = '\n';
+ }
+#endif
+
if (len == 1 && p > buffer)
/* P is pointing at a newline and it's the beginning of
the buffer returned by the last fgets call. However,