mirror of
https://github.com/mirror/make.git
synced 2025-01-03 00:40:34 +08:00
* read.c (get_next_mword): [SV 49865] Make fallthrough explicit.
This commit is contained in:
parent
72af7ce8af
commit
80861cce43
54
read.c
54
read.c
@ -2629,7 +2629,7 @@ readline (struct ebuffer *ebuf)
|
|||||||
static enum make_word_type
|
static enum make_word_type
|
||||||
get_next_mword (char *buffer, char *delim, char **startp, unsigned int *length)
|
get_next_mword (char *buffer, char *delim, char **startp, unsigned int *length)
|
||||||
{
|
{
|
||||||
enum make_word_type wtype = w_bogus;
|
enum make_word_type wtype;
|
||||||
char *p = buffer, *beg;
|
char *p = buffer, *beg;
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
@ -2639,41 +2639,42 @@ get_next_mword (char *buffer, char *delim, char **startp, unsigned int *length)
|
|||||||
|
|
||||||
beg = p;
|
beg = p;
|
||||||
c = *(p++);
|
c = *(p++);
|
||||||
|
|
||||||
|
/* Look at the start of the word to see if it's simple. */
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case '\0':
|
case '\0':
|
||||||
wtype = w_eol;
|
wtype = w_eol;
|
||||||
break;
|
goto done;
|
||||||
|
|
||||||
case ';':
|
case ';':
|
||||||
wtype = w_semicolon;
|
wtype = w_semicolon;
|
||||||
break;
|
goto done;
|
||||||
|
|
||||||
case '=':
|
case '=':
|
||||||
wtype = w_varassign;
|
wtype = w_varassign;
|
||||||
break;
|
goto done;
|
||||||
|
|
||||||
case ':':
|
case ':':
|
||||||
wtype = w_colon;
|
if (*p == '=')
|
||||||
switch (*p)
|
|
||||||
{
|
{
|
||||||
case ':':
|
|
||||||
++p;
|
++p;
|
||||||
if (p[1] != '=')
|
wtype = w_varassign; /* := */
|
||||||
wtype = w_dcolon;
|
}
|
||||||
|
else if (*p == ':')
|
||||||
|
{
|
||||||
|
++p;
|
||||||
|
if (p[1] == '=')
|
||||||
|
{
|
||||||
|
++p;
|
||||||
|
wtype = w_varassign; /* ::= */
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
wtype = w_dcolon;
|
||||||
wtype = w_varassign;
|
|
||||||
++p;
|
|
||||||
}
|
}
|
||||||
break;
|
else
|
||||||
|
wtype = w_colon;
|
||||||
case '=':
|
goto done;
|
||||||
++p;
|
|
||||||
wtype = w_varassign;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '+':
|
case '+':
|
||||||
case '?':
|
case '?':
|
||||||
@ -2681,19 +2682,18 @@ get_next_mword (char *buffer, char *delim, char **startp, unsigned int *length)
|
|||||||
if (*p == '=')
|
if (*p == '=')
|
||||||
{
|
{
|
||||||
++p;
|
++p;
|
||||||
wtype = w_varassign;
|
wtype = w_varassign; /* += or ?= or != */
|
||||||
break;
|
goto done;
|
||||||
}
|
}
|
||||||
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (delim && strchr (delim, c))
|
if (delim && strchr (delim, c))
|
||||||
|
{
|
||||||
wtype = w_static;
|
wtype = w_static;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Did we find something? If so, return now. */
|
|
||||||
if (wtype != w_bogus)
|
|
||||||
goto done;
|
goto done;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* This is some non-operator word. A word consists of the longest
|
/* This is some non-operator word. A word consists of the longest
|
||||||
string of characters that doesn't contain whitespace, one of [:=#],
|
string of characters that doesn't contain whitespace, one of [:=#],
|
||||||
|
Loading…
Reference in New Issue
Block a user