]> git.proxmox.com Git - grub2.git/commitdiff
Make echo UTF-8-clean.
authorColin Watson <cjwatson@debian.org>
Tue, 21 Dec 2010 13:54:49 +0000 (13:54 +0000)
committerColin Watson <cjwatson@debian.org>
Tue, 21 Dec 2010 13:54:49 +0000 (13:54 +0000)
debian/changelog
debian/patches/echo-utf-8-clean.patch [new file with mode: 0644]
debian/patches/series

index e256b30ca703289f31c901cecdd74f9b751ea093..07c355c4570320532dcaf9cf96f9a8d68a3eb793 100644 (file)
@@ -2,7 +2,9 @@ grub2 (1.98+20100804-12) UNRELEASED; urgency=low
 
   * Backport from upstream:
     - Support big ext2 files (closes: #543924).
-    - Fix gettext quoting to work with bash as /bin/sh (closes: #605615).
+    - Fix gettext quoting to work with bash as /bin/sh, and make echo
+      UTF-8-clean so that (at least) Catalan boot messages are displayed
+      properly (closes: #605615).
     - Initialise next pointer when creating multiboot module (closes:
       #605567).
 
diff --git a/debian/patches/echo-utf-8-clean.patch b/debian/patches/echo-utf-8-clean.patch
new file mode 100644 (file)
index 0000000..59693fb
--- /dev/null
@@ -0,0 +1,85 @@
+Description: Make echo UTF-8-clean
+Author: Colin Watson <cjwatson@ubuntu.com>
+Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/2989
+Bug-Debian: http://bugs.debian.org/605615
+Forwarded: yes
+Last-Update: 2010-12-21
+
+Index: b/commands/echo.c
+===================================================================
+--- a/commands/echo.c
++++ b/commands/echo.c
+@@ -44,8 +44,14 @@
+   for (i = 0; i < argc; i++)
+     {
+       char *arg = *args;
++      /* Unescaping results in a string no longer than the original.  */
++      char *unescaped = grub_malloc (grub_strlen (arg) + 1);
++      char *p = unescaped;
+       args++;
++      if (!unescaped)
++      return grub_errno;
++
+       while (*arg)
+       {
+         /* In case `-e' is used, parse backslashes.  */
+@@ -58,11 +64,11 @@
+             switch (*arg)
+               {
+               case '\\':
+-                grub_printf ("\\");
++                *p++ = '\\';
+                 break;
+               case 'a':
+-                grub_printf ("\a");
++                *p++ = '\a';
+                 break;
+               case 'c':
+@@ -70,23 +76,23 @@
+                 break;
+               case 'f':
+-                grub_printf ("\f");
++                *p++ = '\f';
+                 break;
+               case 'n':
+-                grub_printf ("\n");
++                *p++ = '\n';
+                 break;
+               case 'r':
+-                grub_printf ("\r");
++                *p++ = '\r';
+                 break;
+               case 't':
+-                grub_printf ("\t");
++                *p++ = '\t';
+                 break;
+               case 'v':
+-                grub_printf ("\v");
++                *p++ = '\v';
+                 break;
+               }
+             arg++;
+@@ -95,10 +101,14 @@
+         /* This was not an escaped character, or escaping is not
+            enabled.  */
+-        grub_printf ("%c", *arg);
++        *p++ = *arg;
+         arg++;
+       }
++      *p = '\0';
++      grub_xputs (unescaped);
++      grub_free (unescaped);
++
+       /* If another argument follows, insert a space.  */
+       if (i != argc - 1)
+       grub_printf (" " );
index 74aa702c47dc9cd19bfd8c2f2bb17a870bd61bcf..986b7d7a0d0174f3a41a338b2b505bf75739c8cc 100644 (file)
@@ -31,4 +31,5 @@ fix_crash_condition_in_kfreebsd_loader.patch
 ddf1_fakeraid.patch
 ext2-big-files.patch
 gettext-quoting.patch
+echo-utf-8-clean.patch
 multiboot-unaligned-pointer.patch