]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
test: do not stop after first file test or closing bracket
authorAndrei Borzenkov <arvidjaar@gmail.com>
Fri, 30 Jan 2015 17:10:43 +0000 (20:10 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Fri, 30 Jan 2015 17:10:43 +0000 (20:10 +0300)
Closes: 44115
grub-core/commands/test.c

index c98c13d8c24c1aa906b2c09ba38322fb63a15cc2..f58b87c64285c747fc6a7b86d989326b25641aae 100644 (file)
@@ -332,7 +332,7 @@ test_parse (char **args, int *argn, int argc)
              get_fileinfo (args[*argn + 1], &ctx);
              update_val (ctx.file_exists && ctx.file_info.dir, &ctx);
              (*argn) += 2;
-             return ctx.or || ctx.and;
+             continue;
            }
 
          if (grub_strcmp (args[*argn], "-e") == 0)
@@ -340,7 +340,7 @@ test_parse (char **args, int *argn, int argc)
              get_fileinfo (args[*argn + 1], &ctx);
              update_val (ctx.file_exists, &ctx);
              (*argn) += 2;
-             return ctx.or || ctx.and;
+             continue;
            }
 
          if (grub_strcmp (args[*argn], "-f") == 0)
@@ -349,7 +349,7 @@ test_parse (char **args, int *argn, int argc)
              /* FIXME: check for other types. */
              update_val (ctx.file_exists && ! ctx.file_info.dir, &ctx);
              (*argn) += 2;
-             return ctx.or || ctx.and;
+             continue;
            }
 
          if (grub_strcmp (args[*argn], "-s") == 0)
@@ -362,7 +362,7 @@ test_parse (char **args, int *argn, int argc)
                grub_file_close (file);
              grub_errno = GRUB_ERR_NONE;
              (*argn) += 2;
-             return ctx.or || ctx.and;
+             continue;
            }
 
          /* String tests. */
@@ -387,7 +387,7 @@ test_parse (char **args, int *argn, int argc)
       if (grub_strcmp (args[*argn], ")") == 0)
        {
          (*argn)++;
-         return ctx.or || ctx.and;
+         continue;
        }
       /* Recursively invoke if parenthesis. */
       if (grub_strcmp (args[*argn], "(") == 0)