Hi Vladimir, Colin,
On Dec/08/2009, Vladimir '??-coder/phcoder' Serbinenko wrote:
> > My patch made the following transformation:
> >
> > - grub_printf (_("literal string"));
> > + grub_printf ("%s", _("literal string"));
> >
> > This was only necessary in five places, so I doubt that a function is
> > worth it.
> >
> Then it's not worth it. But again we haven't gettext'ized whole grub2
> yet to know for sure. Perhaps a macro so we can change it later if
> necessary?
Vladimir, Colin: see the attached patch with the Colin changes but
macrofied.
Should compile fine in Ubuntu, but I have not tried.
Are we happy with grub_put_ function name?
Colin: could you apply this patch or similar?
I don't want to push more gettext strings before setting up the basic
infrastructure to avoid working twice.
Thanks,
--
Carles Pina i Estany
http://pinux.info
=== modified file 'include/grub/misc.h'
--- include/grub/misc.h 2009-12-08 00:08:52 +0000
+++ include/grub/misc.h 2009-12-09 23:51:07 +0000
@@ -34,6 +34,8 @@
/* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */
#define grub_memcpy(d,s,n) grub_memmove ((d), (s), (n))
+#define grub_put_(str) grub_printf("%s", (str))
+
void *EXPORT_FUNC(grub_memmove) (void *dest, const void *src, grub_size_t n);
char *EXPORT_FUNC(grub_strcpy) (char *dest, const char *src);
char *EXPORT_FUNC(grub_strncpy) (char *dest, const char *src, int c);
=== modified file 'normal/menu_entry.c'
--- normal/menu_entry.c 2009-12-08 00:08:52 +0000
+++ normal/menu_entry.c 2009-12-09 23:46:36 +0000
@@ -1000,7 +1000,7 @@ run (struct screen *screen)
grub_cls ();
grub_printf (" ");
- grub_printf_ (N_("Booting a command list"));
+ grub_put_ (N_("Booting a command list"));
grub_printf ("\n\n");
@@ -1182,6 +1182,6 @@ grub_menu_entry_run (grub_menu_entry_t e
grub_print_error ();
grub_errno = GRUB_ERR_NONE;
grub_putchar ('\n');
- grub_printf_ (N_("Press any key to continue..."));
+ grub_put_ (N_("Press any key to continue..."));
(void) grub_getkey ();
}
=== modified file 'normal/menu_text.c'
--- normal/menu_text.c 2009-12-08 00:08:52 +0000
+++ normal/menu_text.c 2009-12-09 23:47:04 +0000
@@ -40,7 +40,7 @@ void
grub_wait_after_message (void)
{
grub_putchar ('\n');
- grub_printf_ (N_("Press any key to continue..."));
+ grub_put_ (N_("Press any key to continue..."));
(void) grub_getkey ();
grub_putchar ('\n');
}
@@ -206,7 +206,7 @@ entry is highlighted.");
if (nested)
{
grub_printf ("\n ");
- grub_printf_ (N_("ESC to return previous menu."));
+ grub_put_ (N_("ESC to return previous menu."));
}
}
}
@@ -655,7 +655,7 @@ notify_execution_failure (void *userdata
grub_errno = GRUB_ERR_NONE;
}
grub_printf ("\n ");
- grub_printf_ (N_("Failed to boot default entries.\n"));
+ grub_put_ (N_("Failed to boot default entries.\n"));
grub_wait_after_message ();
}
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel