Module Name:    src
Committed By:   christos
Date:           Thu Aug 28 14:39:13 UTC 2014

Modified Files:
        src/usr.bin/make: parse.c

Log Message:
don't leave trailing backlashes on commands, just like gmake does. What does
POSIX have to say?


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.200 src/usr.bin/make/parse.c:1.201
--- src/usr.bin/make/parse.c:1.200	Sat Aug 23 11:05:40 2014
+++ src/usr.bin/make/parse.c	Thu Aug 28 10:39:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.200 2014/08/23 15:05:40 christos Exp $	*/
+/*	$NetBSD: parse.c,v 1.201 2014/08/28 14:39:13 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.200 2014/08/23 15:05:40 christos Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.201 2014/08/28 14:39:13 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.200 2014/08/23 15:05:40 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.201 2014/08/28 14:39:13 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2876,7 +2876,10 @@ ParseGetLine(int flags, int *length)
 		ptr++;
 	    ch = ' ';
 	} else {
-	    *tp++ = '\\';
+	    // Don't add a trailign backslash at theend of a command
+	    // This is what gmake does, but what does POSIX have to say?
+	    if (ptr[0] != '\n' && ptr[0] != '\0')
+		*tp++ = '\\';
 	    if (ptr[0] == '\t')
 		ptr++;
 	}

Reply via email to