Module Name: src
Committed By: rillig
Date: Sat Nov 14 17:29:41 UTC 2020
Modified Files:
src/usr.bin/make: main.c
Log Message:
make(1): use different style of accessing characters in MainParseArgs
The * is preferred for iterators. Since argv[i] is not an iterator but
a fixed string, argv[i][0] expresses the idea "read the first character"
more directly.
To generate a diff of this commit:
cvs rdiff -u -r1.459 -r1.460 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.459 src/usr.bin/make/main.c:1.460
--- src/usr.bin/make/main.c:1.459 Sat Nov 14 15:58:01 2020
+++ src/usr.bin/make/main.c Sat Nov 14 17:29:41 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.459 2020/11/14 15:58:01 rillig Exp $ */
+/* $NetBSD: main.c,v 1.460 2020/11/14 17:29:41 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.459 2020/11/14 15:58:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.460 2020/11/14 17:29:41 rillig Exp $");
#if defined(MAKE_NATIVE) && !defined(lint)
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
"The Regents of the University of California. "
@@ -658,9 +658,9 @@ rearg:
if (Parse_IsVar(argv[1], &var)) {
Parse_DoVar(&var, VAR_CMDLINE);
} else {
- if (!*argv[1])
+ if (argv[1][0] == '\0')
Punt("illegal (null) argument.");
- if (*argv[1] == '-' && !dashDash)
+ if (argv[1][0] == '-' && !dashDash)
goto rearg;
Lst_Append(opts.create, bmake_strdup(argv[1]));
}