diff options
author | Paul Smith <psmith@gnu.org> | 1999-03-31 23:25:13 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 1999-03-31 23:25:13 +0000 |
commit | 7052a5715236b84ebe0b3011c4de75ce19c4ab5d (patch) | |
tree | 5b401afcb479f81fee107132c12ef745991f6579 /read.c | |
parent | 47922a5a659bfe49976bae8f9ce1e11a23006d29 (diff) | |
download | gunmake-7052a5715236b84ebe0b3011c4de75ce19c4ab5d.tar.gz |
* Ignore CR in CRLF line terminators for compatibility with DOSsy
makefiles.
Diffstat (limited to 'read.c')
-rw-r--r-- | read.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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, |