From d29259b134257458a98c1ddc05d2a36c677ded37 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Fri, 30 Jan 2015 20:10:43 +0300 Subject: [PATCH] test: do not stop after first file test or closing bracket Closes: 44115 --- grub-core/commands/test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/grub-core/commands/test.c b/grub-core/commands/test.c index c98c13d8c..f58b87c64 100644 --- a/grub-core/commands/test.c +++ b/grub-core/commands/test.c @@ -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)