From 7955bea0d8b7cfff626dbc74496845a4db6cf8cb Mon Sep 17 00:00:00 2001 From: BVK Chaitanya Date: Thu, 25 Nov 2010 19:05:16 +0530 Subject: [PATCH] fix changelog and doc --- ChangeLog | 7 ++----- grub-core/commands/menuentry.c | 1 - grub-core/lib/legacy_parse.c | 13 ++++++------- include/grub/misc.h | 2 +- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29eb61fd5..e13489f15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,12 +6,9 @@ * grub-core/commands/menuentry.c (setparams_prefix): Use single quotes for arguments. * grub-core/lib/legacy_parse.c (grub_legacy_escape): Use - grub_script_escape_squotes function instead. + grub_strchrsub function instead. - * include/grub/script_sh.h (grub_script_escape_squotes): New - prototype. - * grub-core/script/script.c (grub_script_escape_squotes): New - function. + * include/grub/misc.h (grub_strchrsub): New function. 2010-11-18 Vladimir Serbinenko diff --git a/grub-core/commands/menuentry.c b/grub-core/commands/menuentry.c index c0743d1ed..4dab1783a 100644 --- a/grub-core/commands/menuentry.c +++ b/grub-core/commands/menuentry.c @@ -24,7 +24,6 @@ #include #include #include -#include static const struct grub_arg_option options[] = { diff --git a/grub-core/lib/legacy_parse.c b/grub-core/lib/legacy_parse.c index d3a133591..f7f86c105 100644 --- a/grub-core/lib/legacy_parse.c +++ b/grub-core/lib/legacy_parse.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -323,24 +322,24 @@ struct legacy_command legacy_commands[] = char * grub_legacy_escape (const char *in, grub_size_t len) { - char saved; char *ptr; - char *outptr; + char saved; + char *ret; int overhead = 0; for (ptr = (char*)in; ptr < in + len && *ptr; ptr++) if (*ptr == '\'') overhead += 3; - outptr = grub_malloc (ptr - in + overhead + 1); - if (!outptr) + ret = grub_malloc (ptr - in + overhead + 1); + if (!ret) return NULL; ptr = (char*)in; saved = ptr[len]; ptr[len] = '\0'; - grub_strchrsub (outptr, in, '\'', "'\\''"); + grub_strchrsub (ret, ptr, '\'', "'\\''"); ptr[len] = saved; - return outptr; + return ret; } static char * diff --git a/include/grub/misc.h b/include/grub/misc.h index 4980281a6..6fcaa148b 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -194,7 +194,7 @@ grub_strncasecmp (const char *s1, const char *s2, grub_size_t n) } /* Replace all `ch' characters of `input' with `with' and copy the - result into `output'; return address of the end in `output'. */ + result into `output'; return EOS address of `output'. */ static inline char * grub_strchrsub (char *output, const char *input, char ch, const char *with) {