* util/grub-script-check.c (main): Ensure defined behaviour on empty
input files (in which case exit zero).
This commit is contained in:
parent
db2102a046
commit
d870813427
2 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2010-05-27 Colin Watson <cjwatson@ubuntu.com>
|
||||
|
||||
* util/grub-script-check.c (main): Ensure defined behaviour on empty
|
||||
input files (in which case exit zero).
|
||||
|
||||
2010-05-27 Colin Watson <cjwatson@ubuntu.com>
|
||||
|
||||
* kern/emu/misc.c (canonicalize_file_name): realpath can still
|
||||
|
|
|
@ -145,7 +145,8 @@ main (int argc, char *argv[])
|
|||
char *input;
|
||||
FILE *file = 0;
|
||||
int verbose = 0;
|
||||
struct grub_script *script;
|
||||
int found_input = 0;
|
||||
struct grub_script *script = NULL;
|
||||
|
||||
auto grub_err_t get_config_line (char **line, int cont);
|
||||
grub_err_t get_config_line (char **line, int cont __attribute__ ((unused)))
|
||||
|
@ -247,6 +248,7 @@ main (int argc, char *argv[])
|
|||
get_config_line(&input, 0);
|
||||
if (! input)
|
||||
break;
|
||||
found_input = 1;
|
||||
|
||||
script = grub_script_parse (input, get_config_line);
|
||||
if (script)
|
||||
|
@ -262,5 +264,5 @@ main (int argc, char *argv[])
|
|||
grub_fini_all ();
|
||||
if (file) fclose (file);
|
||||
|
||||
return (script == 0);
|
||||
return (found_input && script == 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue