]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
pull-in func-params branch
authorBVK Chaitanya <bvk.groups@gmail.com>
Fri, 21 May 2010 10:45:09 +0000 (16:15 +0530)
committerBVK Chaitanya <bvk.groups@gmail.com>
Fri, 21 May 2010 10:45:09 +0000 (16:15 +0530)
1  2 
script/argv.c
script/execute.c

diff --cc script/argv.c
Simple merge
index 6a37de33d5a11c5553f1674116294263b5ebc941,4a3f249b085dfe1d9cfa93c7c39c2bf6d5133d6f..47e47b6ebb942be714d627de6599f2bd3fdbb3cc
@@@ -175,15 -186,11 +186,21 @@@ grub_script_arglist_to_argv (struct gru
              values = grub_script_env_get (arg->str, arg->type);
              for (i = 0; values && values[i]; i++)
                {
-                 if (i != 0)
-                   error += grub_script_argv_next (&result);
+                 if (i != 0 && grub_script_argv_next (&result))
+                   goto fail;
  
 -                if (grub_script_argv_append (&result, values[i]))
 -                  goto fail;
 +                if (arg->type == GRUB_SCRIPT_ARG_TYPE_VAR)
-                   error += grub_script_argv_append (&result, values[i]);
++                  {
++                    if (grub_script_argv_append (&result, values[i]))
++                      goto fail;
++                  }
 +                else
-                   error += grub_script_argv_append_escaped (&result, values[i]);
++                  {
++                    if (grub_script_argv_append_escaped (&result, values[i]))
++                      goto fail;
++                  }
 +
 +                grub_free (values[i]);
                }
              grub_free (values);
              break;
    if (! result.args[result.argc - 1])
      result.argc--;
  
-   error += grub_script_argv_expand (&result);
-   if (error)
-     {
-       grub_script_argv_free (&result);
-       return 1;
-     }
++  if (grub_script_argv_expand (&result))
++    goto fail;
 +
    *argv = result;
    return 0;
+  fail:
+   grub_script_argv_free (&result);
+   return 1;
  }
  
  static grub_err_t