Changeset 4235

Show
Ignore:
Timestamp:
11/12/06 19:24:55 (7 years ago)
Author:
mmh
Message:

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.

Location:
lm-sensors/trunk/lib
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/lib/conf-lex.l

    r4222 r4235  
    263263<STRING>{ 
    264264 
    265  /* Oops, newline while in a string is not good */ 
     265 /* Oops, newline or EOF while in a string is not good */ 
    266266 
    267267\n              | 
    268268\\\n            { 
    269269                  buffer_add_char("\0"); 
    270                   strcpy(sensors_lex_error,"No matching double quote"); 
     270                  strcpy(sensors_lex_error, 
     271                        "No matching double quote."); 
    271272                  buffer_free(); 
    272                   BEGIN(INITIAL); 
     273                  yyless(0); 
     274                  BEGIN(ERR); 
     275                  return ERROR; 
     276                } 
     277 
     278<<EOF>>         { 
     279                  strcpy(sensors_lex_error, 
     280                        "Reached end-of-file without a matching double quote."); 
     281                  BEGIN(MIDDLE); 
    273282                  return ERROR; 
    274283                } 
     
    276285 /* At the end */ 
    277286 
     287\"\"            { 
     288                  buffer_add_char("\0"); 
     289                  strcpy(sensors_lex_error, 
     290                        "Quoted strings must be separated by whitespace."); 
     291                  buffer_free(); 
     292                  BEGIN(ERR); 
     293                  return ERROR; 
     294                } 
     295                 
    278296\"              { 
    279297                  buffer_add_char("\0"); 
  • lm-sensors/trunk/lib/sensors.conf.5

    r4208 r4235  
    3535Comments are introduces by hash marks. A comment continues to the end of the 
    3636line. Empty lines, and lines containing only whitespace or comments are  
    37 ignored.  Other lines have one of the below forms. There should be whitespace 
     37ignored.  Other lines have one of the below forms. There must be whitespace 
    3838between each element, but the amount of whitespace is unimportant. A line 
    3939may be continued on the next line by ending it with a backslash; this does