mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-14 10:29:31 +00:00
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:
1 parent
68558575ad
commit
dcdd19ed72
2 files changed
+22
-4
No files matched your search
+21
-3
@@ -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);
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ translate the raw readings from the kernel modules to real\-world values.
|
||||
.SH SYNTAX
|
||||
Comments are introduces by hash marks. A comment continues to the end of the
|
||||
line. Empty lines, and lines containing only whitespace or comments are
|
||||
ignored. Other lines have one of the below forms. There should be whitespace
|
||||
ignored. Other lines have one of the below forms. There must be whitespace
|
||||
between each element, but the amount of whitespace is unimportant. A line
|
||||
may be continued on the next line by ending it with a backslash; this does
|
||||
not work within a comment,
|
||||
|
||||
Reference in new issue
Block a user