* 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 <phcoder@gmail.com>
#include <grub/extcmd.h>
#include <grub/i18n.h>
#include <grub/normal.h>
-#include <grub/script_sh.h>
static const struct grub_arg_option options[] =
{
#include <grub/misc.h>
#include <grub/mm.h>
#include <grub/err.h>
-#include <grub/script_sh.h>
#include <grub/legacy_parse.h>
#include <grub/i386/pc/vesa_modes_table.h>
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 *
}
/* 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)
{