Module Name: src Committed By: rillig Date: Sun Nov 8 01:43:58 UTC 2020
Modified Files: src/usr.bin/make: main.c Log Message: make(1): merge duplicate code in is_relpath To generate a diff of this commit: cvs rdiff -u -r1.438 -r1.439 src/usr.bin/make/main.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/main.c diff -u src/usr.bin/make/main.c:1.438 src/usr.bin/make/main.c:1.439 --- src/usr.bin/make/main.c:1.438 Sun Nov 8 01:40:01 2020 +++ src/usr.bin/make/main.c Sun Nov 8 01:43:58 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.438 2020/11/08 01:40:01 rillig Exp $ */ +/* $NetBSD: main.c,v 1.439 2020/11/08 01:43:58 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -109,7 +109,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.438 2020/11/08 01:40:01 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.439 2020/11/08 01:43:58 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -151,7 +151,7 @@ static int errors = 0; /* * For compatibility with the POSIX version of MAKEFLAGS that includes - * all the options with out -, convert flags to -f -l -a -g -s. + * all the options without '-', convert 'flags' to '-f -l -a -g -s'. */ static char * explode(const char *flags) @@ -341,12 +341,10 @@ is_relpath(const char *path) cp = path; while ((cp = strstr(cp, "/.")) != NULL) { cp += 2; + if (*cp == '.') + cp++; if (cp[0] == '/' || cp[0] == '\0') return TRUE; - else if (cp[0] == '.') { - if (cp[1] == '/' || cp[1] == '\0') - return TRUE; - } } return FALSE; }