summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2003-03-24 23:14:15 +0000
committerPaul Smith <psmith@gnu.org>2003-03-24 23:14:15 +0000
commit4068c5e4a3eb0f47ec3cb4ee4fad5dd2edb9de6f (patch)
treee65ea91d7e7e0da97075c48aa69db62d8ec19af9 /read.c
parent1fa3db14684b18e50383be6a83a1f17f716b0788 (diff)
downloadgunmake-4068c5e4a3eb0f47ec3cb4ee4fad5dd2edb9de6f.tar.gz
Add support for OS/2, contributed by Andreas Buening <andreas.buening@nexgo.de>
Also a small patch from Hartmut Becker <Hartmut.Becker@compaq.com> for VMS.
Diffstat (limited to 'read.c')
-rw-r--r--read.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/read.c b/read.c
index 47d727b..40ff3d6 100644
--- a/read.c
+++ b/read.c
@@ -561,12 +561,16 @@ eval (struct ebuffer *ebuf, int set_default)
}
}
- /* This line is not a shell command line. Don't worry about tabs. */
+ /* This line is not a shell command line. Don't worry about tabs.
+ Get more space if we need it; we don't need to preserve the current
+ contents of the buffer. */
if (collapsed_length < linelen+1)
{
collapsed_length = linelen+1;
- collapsed = (char *) xrealloc (collapsed, collapsed_length);
+ if (collapsed)
+ free ((char *)collapsed);
+ collapsed = (char *) xmalloc (collapsed_length);
}
strcpy (collapsed, line);
/* Collapse continuation lines. */
@@ -1150,7 +1154,7 @@ eval (struct ebuffer *ebuf, int set_default)
do {
check_again = 0;
- /* For DOS paths, skip a "C:\..." or a "C:/..." */
+ /* For DOS-style paths, skip a "C:\..." or a "C:/..." */
if (p != 0 && (p[1] == '\\' || p[1] == '/') &&
isalpha ((unsigned char)p[-1]) &&
(p == p2 + 1 || strchr (" \t:(", p[-2]) != 0)) {
@@ -2559,7 +2563,7 @@ readline (struct ebuffer *ebuf)
/* We got a newline, so add one to the count of lines. */
++nlines;
-#if !defined(WINDOWS32) && !defined(__MSDOS__)
+#if !defined(WINDOWS32) && !defined(__MSDOS__) && !defined(__EMX__)
/* Check to see if the line was really ended with CRLF; if so ignore
the CR. */
if ((p - start) > 1 && p[-2] == '\r')