diff options
author | sjg <sjg@FreeBSD.org> | 2013-09-05 20:18:59 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2013-09-05 20:18:59 +0000 |
commit | 62bb1062226d3ce6a2350808256a25508978352d (patch) | |
tree | 22b131dceb13c3df96da594fbaadb693504797c7 /usr.sbin/config | |
parent | 72ab90509b3a51ab361bf710338f2ef44a4e360d (diff) | |
parent | 04932445481c2cb89ff69a83b961bdef3d64757e (diff) | |
download | FreeBSD-src-62bb1062226d3ce6a2350808256a25508978352d.zip FreeBSD-src-62bb1062226d3ce6a2350808256a25508978352d.tar.gz |
Merge from head
Diffstat (limited to 'usr.sbin/config')
-rw-r--r-- | usr.sbin/config/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/config/lang.l | 8 | ||||
-rw-r--r-- | usr.sbin/config/main.c | 14 |
3 files changed, 11 insertions, 13 deletions
diff --git a/usr.sbin/config/Makefile b/usr.sbin/config/Makefile index 6faf847..6561989 100644 --- a/usr.sbin/config/Makefile +++ b/usr.sbin/config/Makefile @@ -11,6 +11,8 @@ kernconf.c: kernconf.tmpl CFLAGS+= -I. -I${.CURDIR} +NO_WMISSING_VARIABLE_DECLARATIONS= + DPADD= ${LIBL} ${LIBSBUF} LDADD= -ll -lsbuf diff --git a/usr.sbin/config/lang.l b/usr.sbin/config/lang.l index 81f820f..3e4e115 100644 --- a/usr.sbin/config/lang.l +++ b/usr.sbin/config/lang.l @@ -38,9 +38,6 @@ #include "y.tab.h" #include "config.h" -#define YY_NO_UNPUT -#define YY_NO_INPUT - /* * Data for returning to previous files from include files. */ @@ -96,7 +93,12 @@ unsigned int octal(const char *); unsigned int hex(const char *); int yyerror(const char *); +#define YY_DECL int yylex(void) %} + +%option nounput +%option noinput + ID [A-Za-z_][-A-Za-z_0-9]* PATH [./][-/.%^A-Za-z_0-9]+ %START TOEOL diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c index 3ed5495..78bb13d 100644 --- a/usr.sbin/config/main.c +++ b/usr.sbin/config/main.c @@ -706,17 +706,11 @@ kernconfdump(const char *file) r = fgetc(fp); if (r == EOF) break; - /* - * If '\0' is present in the middle of the configuration - * string, this means something very weird is happening. - * Make such case very visible. However, some architectures - * pad the length of the section with NULs to a multiple of - * sh_addralign, allow a NUL in that part of the section. - */ - if (r == '\0' && (size - i) < align) + if (r == '\0') { + assert(i == size - 1 && + ("\\0 found in the middle of a file")); break; - assert(r != '\0' && ("Char present in the configuration " - "string mustn't be equal to 0")); + } fputc(r, stdout); } fclose(fp); |