The scanner regression test cases for error conditions in quoted strings

uncovered three different bugs.  This changeset fixes them all.  It also
updates the sensors.conf(5) man page to be unambiguous regarding the
requirement for whitespace between elements.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4235 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Mark M. Hoffman committed 2006-11-12 18:24:55 +00:00
1 parent 68558575ad
commit dcdd19ed72
2 files changed
+22 -4

No files matched your search

+21 -3
View File
@@ -262,19 +262,37 @@ ignore{BLANK}* {
<STRING>{
/* Oops, newline while in a string is not good */
/* Oops, newline or EOF while in a string is not good */
\n |
\\\n {
buffer_add_char("\0");
strcpy(sensors_lex_error,"No matching double quote");
strcpy(sensors_lex_error,
"No matching double quote.");
buffer_free();
BEGIN(INITIAL);
yyless(0);
BEGIN(ERR);
return ERROR;
}
<<EOF>> {
strcpy(sensors_lex_error,
"Reached end-of-file without a matching double quote.");
BEGIN(MIDDLE);
return ERROR;
}
/* At the end */
\"\" {
buffer_add_char("\0");
strcpy(sensors_lex_error,
"Quoted strings must be separated by whitespace.");
buffer_free();
BEGIN(ERR);
return ERROR;
}
\" {
buffer_add_char("\0");
sensors_yylval.name = strdup(buffer);