Skip to content

Commit

Permalink
kconfig: narrow the scope of variables in the lexer
Browse files Browse the repository at this point in the history
The variables, "ts" and "i", are used locally in the action of
the [ \t]+ pattern in the <HELP> start state.

Define them where they are used.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
masahir0y committed Sep 29, 2021
1 parent d05377e commit 65017d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/kconfig/lexer.l
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ n [A-Za-z0-9_-]

%%
int str = 0;
int ts, i;

#.* /* ignore comment */
[ \t]* /* whitespaces */
Expand Down Expand Up @@ -196,6 +195,8 @@ n [A-Za-z0-9_-]

<HELP>{
[ \t]+ {
int ts, i;

ts = 0;
for (i = 0; i < yyleng; i++) {
if (yytext[i] == '\t')
Expand Down

0 comments on commit 65017d8

Please sign in to comment.