From 8bc55d43960af8c74f9e3e3e76b5746ffbaff37e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 19 Nov 2019 11:43:20 -0600 Subject: [PATCH] tools/nxstyle.c: Trivial improvement to preceding change to allow white space separation. --- tools/nxstyle.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/nxstyle.c b/tools/nxstyle.c index 114f41e0a2..fb71c3f895 100644 --- a/tools/nxstyle.c +++ b/tools/nxstyle.c @@ -1075,6 +1075,7 @@ int main(int argc, char **argv, char **envp) line[n + 1] != ';') { int sndx = n + 1; + bool whitespace = false; /* Skip over spaces */ @@ -1104,6 +1105,14 @@ int main(int argc, char **argv, char **envp) endx++; } + /* Skip over spaces */ + + while (line[endx] == ' ') + { + whitespace = true; + endx++; + } + /* Handle according to what comes after the * identifier. */ @@ -1120,7 +1129,16 @@ int main(int argc, char **argv, char **envp) "Multiple data definitions on line %d:%d\n", lineno, endx); } - else if (line[endx] != ';') + else if (line[endx] == ';') + { + if (whitespace) + { + fprintf(stderr, + "Space precedes semi-colon at line %d:%d\n", + lineno, endx); + } + } + else { fprintf(stderr, "Garbage follows right bracket at line %d:%d\n",