summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/misc.c b/misc.c
index 55b0dd8..0ea56bb 100644
--- a/misc.c
+++ b/misc.c
@@ -112,12 +112,17 @@ collapse_continuations (char *line)
/* Skip the newline. */
++in;
- /* If the newline is escaped, discard following whitespace leaving just
- one space. POSIX requires that each backslash/newline/following
- whitespace sequence be reduced to a single space. */
if (backslash)
{
+ /* Backslash/newline handling:
+ In traditional GNU make all trailing whitespace, consecutive
+ backslash/newlines, and any leading whitespace on the next line
+ is reduced to a single space.
+ In POSIX, each backslash/newline and is replaced by a space. */
in = next_token (in);
+ if (! posix_pedantic)
+ while (out > line && isblank ((unsigned char)out[-1]))
+ --out;
*out++ = ' ';
}
else