summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1994-05-05 08:15:00 +0000
committerRoland McGrath <roland@redhat.com>1994-05-05 08:15:00 +0000
commit65d0cd98a9fc51a4737c1e160eaf39207e47bda0 (patch)
treea701a90b3d6f6ade6803b5ddf739e7c3c15029bd /read.c
parentec505152e04968cb01b074f07f26c360a2931294 (diff)
downloadgunmake-65d0cd98a9fc51a4737c1e160eaf39207e47bda0.tar.gz
(do_define): Call collapse_continuations on each line before all else.
Diffstat (limited to 'read.c')
-rw-r--r--read.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/read.c b/read.c
index 449bf01..054cee3 100644
--- a/read.c
+++ b/read.c
@@ -811,12 +811,13 @@ do_define (name, namelen, origin, lineno, infile, filename)
{
lineno += nlines;
nlines = readline (&lb, infile, filename, lineno);
- p = next_token (lb.buffer);
+ collapse_continuations (lb.buffer);
+
+ p = next_token (lb.buffer);
if ((p[5] == '\0' || isblank (p[5])) && !strncmp (p, "endef", 5))
{
p += 5;
- collapse_continuations (p);
remove_comments (p);
if (*next_token (p) != '\0')
makefile_error (filename, lineno,
@@ -833,7 +834,7 @@ do_define (name, namelen, origin, lineno, infile, filename)
}
else
{
- unsigned int len = strlen (p);
+ unsigned int len = strlen (lb.buffer);
/* Increase the buffer size if necessary. */
if (idx + len + 1 > length)
@@ -842,7 +843,7 @@ do_define (name, namelen, origin, lineno, infile, filename)
definition = (char *) xrealloc (definition, length + 1);
}
- bcopy (p, &definition[idx], len);
+ bcopy (lb.buffer, &definition[idx], len);
idx += len;
/* Separate lines with a newline. */
definition[idx++] = '\n';