mirror of
https://github.com/sheumann/hush.git
synced 2024-08-22 02:29:00 +00:00
fix extra bogus files generation in include/config/*
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
3324c96335
commit
2f41e7ea57
@ -243,23 +243,28 @@ void parse_config_file(char *map, size_t len)
|
|||||||
if (!memcmp(p, "IF_NOT", 6)) goto conf7;
|
if (!memcmp(p, "IF_NOT", 6)) goto conf7;
|
||||||
}
|
}
|
||||||
/* we have at least 3 chars because of p <= end_3 */
|
/* we have at least 3 chars because of p <= end_3 */
|
||||||
/*if (!memcmp(p, "IF_", 3)) goto conf3;*/
|
/*if (!memcmp(p, "IF_", 3)) ...*/
|
||||||
if (p[0] == 'I' && p[1] == 'F' && p[2] == '_') goto conf3;
|
if (p[0] == 'I' && p[1] == 'F' && p[2] == '_') {
|
||||||
|
off = 3;
|
||||||
|
goto conf;
|
||||||
|
}
|
||||||
|
|
||||||
/* This identifier is not interesting, skip it */
|
/* This identifier is not interesting, skip it */
|
||||||
while (p <= end_3 && (isalnum(*p) || *p == '_'))
|
while (p <= end_3 && (isalnum(*p) || *p == '_'))
|
||||||
p++;
|
p++;
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
conf3: off = 3;
|
|
||||||
conf7: off = 7;
|
conf7: off = 7;
|
||||||
|
conf:
|
||||||
p += off;
|
p += off;
|
||||||
for (q = p; q < end_3+3; q++) {
|
for (q = p; q < end_3+3; q++) {
|
||||||
if (!(isalnum(*q) || *q == '_'))
|
if (!(isalnum(*q) || *q == '_'))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (q != p) {
|
||||||
use_config(p, q-p);
|
use_config(p, q-p);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* test is s ends in sub */
|
/* test is s ends in sub */
|
||||||
|
@ -110,11 +110,12 @@ int main(int argc, const char * argv [])
|
|||||||
|
|
||||||
if (line[0] != '#')
|
if (line[0] != '#')
|
||||||
continue;
|
continue;
|
||||||
if ((str_config = strstr(line, "CONFIG_")) == NULL)
|
if ((str_config = strstr(line, " CONFIG_")) == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Make the output file name. */
|
/* We found #define CONFIG_foo or #undef CONFIG_foo.
|
||||||
str_config += sizeof("CONFIG_") - 1;
|
* Make the output file name. */
|
||||||
|
str_config += sizeof(" CONFIG_") - 1;
|
||||||
for (itarget = 0; !isspace(str_config[itarget]); itarget++)
|
for (itarget = 0; !isspace(str_config[itarget]); itarget++)
|
||||||
{
|
{
|
||||||
int c = (unsigned char) str_config[itarget];
|
int c = (unsigned char) str_config[itarget];
|
||||||
|
Loading…
Reference in New Issue
Block a user