BVK Chaitanya wrote: > Hi, > > > Attached patch adds function parameters ($1, $2, etc. and $#) support > to GRUB script.. Shell expansion for "$@" and $@ specials is not yet > available. > > PS: It needs to be applied over my earlier, remove grub_script_cmdblock > patch. > >
+ grub_error (GRUB_ERR_BAD_ARGUMENT, "bad variabe name substitution"); typo The only place where new scope is added or removed is: + grub_list_push (GRUB_AS_LIST_P (&scope), GRUB_AS_LIST (&new_scope)); + + ret = grub_script_execute (func->func); + + grub_list_pop (GRUB_AS_LIST_P (&scope)); + So you can actually do sth like: int current_script_argc; char *current_script_args; And have an update function with: saved_args = current_script_args; saved_argc = current_script_argc; current_script_args = .. current_script_argsc = ...; ret = ....; current_script_args = saved_args; current_script_argc = saved_argc; - grub_env_set ("?", errnobuf); + grub_script_env_set ("?", errnobuf); Any use of this change? > > ------------------------------------------------------------------------ > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel -- Regards Vladimir 'φ-coder/phcoder' Serbinenko
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel