Eliminate script line length limit
PATCH 1/1 Eliminate script line length limit
Making GNU GRUB more GNU ;)
Signature · 4 lines
Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
script/sh/function.c +1 -1
@@ -99,7 +99,7 @@ grub_script_function_find (char *functionname)break ;if (! func) -grub_error (GRUB_ERR_UNKNOWN_COMMAND ,"unknown command `%s'" , functionname); +grub_error (GRUB_ERR_UNKNOWN_COMMAND ,"unknown command `%.20s'" , functionname);return func; }
script/sh/lexer.c +56 -22
134 lines not on this page · raw message
script/sh/script.c +4 -1
@@ -110,10 +110,13 @@ grub_script_arg_add (struct grub_parser_param *state, struct grub_script_arg *ar {struct grub_script_arg *argpart;struct grub_script_arg *ll; +int len; argpart = (struct grub_script_arg *)grub_script_malloc (state,sizeof (*arg)); argpart->type = type; - argpart->str = str; + len =grub_strlen (str) +1 ; + argpart->str =grub_script_malloc (state, len); +grub_memcpy (argpart->str, str, len); argpart->next =0 ;if (! arg)
Quoted 1 line · Vladimir 'phcoder' Serbinenko
Making GNU GRUB more GNU ;)
Good! But please could you use NULL for pointers? :-)
Also, remember to include a ChangeLog entry.
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
Quoted 20 lines · Robert Millan
Quoted 1 line · Vladimir 'phcoder' Serbinenko
Making GNU GRUB more GNU ;)
Good! But please could you use NULL for pointers? :-)
Also, remember to include a ChangeLog entry.
--
Robert MillanThe DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 4 lines
Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
ChangeLog +8 -0
@@ -1,5 +1,13 @@ 2009-08-24 Vladimir Serbinenko <[email protected]> + * script/sh/function.c (grub_script_function_find): Cut error message + not to flood terminal. + * script/sh/lexer.c (grub_script_yylex): Remove command line length + limit. + * script/sh/script.c (grub_script_arg_add): Duplicate string. + +2009-08-24 Vladimir Serbinenko <[email protected]> + Rename *_partition_map to part_* * partmap/acorn.c (grub_acorn_partition_map): Set name to 'part_acorn'.
script/sh/function.c +1 -1
@@ -99,7 +99,7 @@ grub_script_function_find (char *functionname)break ;if (! func) -grub_error (GRUB_ERR_UNKNOWN_COMMAND ,"unknown command `%s'" , functionname); +grub_error (GRUB_ERR_UNKNOWN_COMMAND ,"unknown command `%.20s'" , functionname);return func; }
script/sh/lexer.c +56 -22
134 lines not on this page · raw message
script/sh/script.c +4 -1
@@ -110,10 +110,13 @@ grub_script_arg_add (struct grub_parser_param *state, struct grub_script_arg *ar {struct grub_script_arg *argpart;struct grub_script_arg *ll; +int len; argpart = (struct grub_script_arg *)grub_script_malloc (state,sizeof (*arg)); argpart->type = type; - argpart->str = str; + len =grub_strlen (str) +1 ; + argpart->str =grub_script_malloc (state, len); +grub_memcpy (argpart->str, str, len); argpart->next =0 ;if (! arg)
Review
Quoted 1 line · Vladimir 'phcoder' Serbinenko
(quoted diff) +1
-0+ but extends automaticlly when needed. */
Typo :-)
Other than this, it looks fine. Thanks!
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
Quoted 7 lines · Robert Millan
Quoted 1 line · Vladimir 'phcoder' Serbinenko
+ but extends automaticlly when needed. */
Typo :-)
Other than this, it looks fine. Thanks!
Fixed and comitted
Quoted 13 lines
--
Robert MillanThe DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 4 lines
Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git