diff options
Diffstat (limited to 'payloads/libpayload/util/kconfig/zconf.l')
-rw-r--r-- | payloads/libpayload/util/kconfig/zconf.l | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/payloads/libpayload/util/kconfig/zconf.l b/payloads/libpayload/util/kconfig/zconf.l index cfa46077c6..4cea5c85cd 100644 --- a/payloads/libpayload/util/kconfig/zconf.l +++ b/payloads/libpayload/util/kconfig/zconf.l @@ -217,6 +217,11 @@ n [A-Za-z0-9_] append_string("\n", 1); } [^ \t\n].* { + while (yyleng) { + if ((yytext[yyleng-1] != ' ') && (yytext[yyleng-1] != '\t')) + break; + yyleng--; + } append_string(yytext, yyleng); if (!first_ts) first_ts = last_ts; @@ -265,7 +270,7 @@ FILE *zconf_fopen(const char *name) FILE *f; f = fopen(name, "r"); - if (!f && name[0] != '/') { + if (!f && name != NULL && name[0] != '/') { env = getenv(SRCTREE); if (env) { sprintf(fullname, "%s/%s", env, name); |