Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make(1): eliminate unsatisfiable condition in i...



details:   https://anonhg.NetBSD.org/src/rev/3fc9ebb5a810
branches:  trunk
changeset: 936648:3fc9ebb5a810
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 01 08:49:47 2020 +0000

description:
make(1): eliminate unsatisfiable condition in is_relpath

diffstat:

 usr.bin/make/main.c |  15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diffs (57 lines):

diff -r 09d33233de00 -r 3fc9ebb5a810 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Sat Aug 01 08:47:05 2020 +0000
+++ b/usr.bin/make/main.c       Sat Aug 01 08:49:47 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.285 2020/07/31 20:22:10 sjg Exp $   */
+/*     $NetBSD: main.c,v 1.286 2020/08/01 08:49:47 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.285 2020/07/31 20:22:10 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.286 2020/08/01 08:49:47 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
@@ -81,7 +81,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.285 2020/07/31 20:22:10 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.286 2020/08/01 08:49:47 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -368,7 +368,7 @@
 /*
  * does path contain any relative components
  */
-static int
+static Boolean
 is_relpath(const char *path)
 {
        const char *cp;
@@ -376,10 +376,7 @@
        if (path[0] != '/')
                return TRUE;
        cp = path;
-       do {
-               cp = strstr(cp, "/.");
-               if (!cp)
-                       break;
+       while ((cp = strstr(cp, "/.")) != NULL) {
                cp += 2;
                if (cp[0] == '/' || cp[0] == '\0')
                        return TRUE;
@@ -387,7 +384,7 @@
                        if (cp[1] == '/' || cp[1] == '\0')
                                return TRUE;
                }
-       } while (cp);
+       }
        return FALSE;
 }
 



Home | Main Index | Thread Index | Old Index