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: rename local variable in ParseRawLine
details: https://anonhg.NetBSD.org/src/rev/b961ed48a47a
branches: trunk
changeset: 359497:b961ed48a47a
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Jan 07 21:57:26 2022 +0000
description:
make: rename local variable in ParseRawLine
The previous variable name suggested that the variable would point to
the first '#' character of the line, instead it points to the whitespace
before the first '#'.
No functional change.
diffstat:
usr.bin/make/parse.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diffs (86 lines):
diff -r 860129196b4e -r b961ed48a47a usr.bin/make/parse.c
--- a/usr.bin/make/parse.c Fri Jan 07 21:40:56 2022 +0000
+++ b/usr.bin/make/parse.c Fri Jan 07 21:57:26 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.635 2022/01/07 21:40:56 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.636 2022/01/07 21:57:26 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -106,7 +106,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.635 2022/01/07 21:40:56 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.636 2022/01/07 21:57:26 rillig Exp $");
/*
* A file being read.
@@ -2299,14 +2299,14 @@
*/
static ParseRawLineResult
ParseRawLine(IncludedFile *curFile, char **out_line, char **out_line_end,
- char **out_firstBackslash, char **out_firstComment)
+ char **out_firstBackslash, char **out_commentLineEnd)
{
char *line = curFile->buf_ptr;
char *buf_end = curFile->buf_end;
char *p = line;
char *line_end = line;
char *firstBackslash = NULL;
- char *firstComment = NULL;
+ char *commentLineEnd = NULL;
ParseRawLineResult res = PRLR_LINE;
curFile->readLines++;
@@ -2349,9 +2349,9 @@
* Remember the first '#' for comment stripping, unless
* the previous char was '[', as in the modifier ':[#]'.
*/
- if (ch == '#' && firstComment == NULL &&
+ if (ch == '#' && commentLineEnd == NULL &&
!(p > line && p[-1] == '['))
- firstComment = line_end;
+ commentLineEnd = line_end;
p++;
if (ch == '\n')
@@ -2366,7 +2366,7 @@
*out_line = line;
*out_line_end = line_end;
*out_firstBackslash = firstBackslash;
- *out_firstComment = firstComment;
+ *out_commentLineEnd = commentLineEnd;
return res;
}
@@ -2454,15 +2454,15 @@
char *line;
char *line_end;
char *firstBackslash;
- char *firstComment;
+ char *commentLineEnd;
for (;;) {
ParseRawLineResult res = ParseRawLine(curFile,
- &line, &line_end, &firstBackslash, &firstComment);
+ &line, &line_end, &firstBackslash, &commentLineEnd);
if (res == PRLR_ERROR)
return NULL;
- if (line_end == line || firstComment == line) {
+ if (line == line_end || line == commentLineEnd) {
if (res == PRLR_EOF)
return NULL;
if (kind != LK_FOR_BODY)
@@ -2482,8 +2482,8 @@
}
/* Ignore anything after a non-escaped '#' in non-commands. */
- if (firstComment != NULL && line[0] != '\t')
- *firstComment = '\0';
+ if (commentLineEnd != NULL && line[0] != '\t')
+ *commentLineEnd = '\0';
/* If we didn't see a '\\' then the in-situ data is fine. */
if (firstBackslash == NULL)
Home |
Main Index |
Thread Index |
Old Index