Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make don't leave trailing backlashes on commands, ju...



details:   https://anonhg.NetBSD.org/src/rev/8721f07b7728
branches:  trunk
changeset: 802021:8721f07b7728
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Aug 28 14:39:13 2014 +0000

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

diffstat:

 usr.bin/make/parse.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r e12d2ea5cb0f -r 8721f07b7728 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Thu Aug 28 13:45:59 2014 +0000
+++ b/usr.bin/make/parse.c      Thu Aug 28 14:39:13 2014 +0000
@@ -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 @@
                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++;
        }



Home | Main Index | Thread Index | Old Index