Revision: 1963
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1963
Author:   chrfranke
Date:     2009-01-30 21:10:17 +0000 (Fri, 30 Jan 2009)

Log Message:
-----------
2009-01-30  Christian Franke  <[email protected]>

        * normal/arg.c (grub_arg_show_help): Add indentation if '\n' appears
        in option help text.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/normal/arg.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog       2009-01-28 02:19:07 UTC (rev 1962)
+++ trunk/grub2/ChangeLog       2009-01-30 21:10:17 UTC (rev 1963)
@@ -1,3 +1,8 @@
+2009-01-30  Christian Franke  <[email protected]>
+
+       * normal/arg.c (grub_arg_show_help): Add indentation if '\n' appears
+       in option help text.
+
 2009-01-27  Pavel Roskin  <[email protected]>
 
        * disk/fs_uuid.c (search_fs_uuid): Ignore case of the UUID.

Modified: trunk/grub2/normal/arg.c
===================================================================
--- trunk/grub2/normal/arg.c    2009-01-28 02:19:07 UTC (rev 1962)
+++ trunk/grub2/normal/arg.c    2009-01-30 21:10:17 UTC (rev 1963)
@@ -156,11 +156,22 @@
                }
            }
 
-         while (spacing-- > 0)
-           grub_putchar (' ');
+         const char *doc = opt->doc;
+         for (;;)
+           {
+             while (spacing-- > 0)
+               grub_putchar (' ');
 
-         grub_printf ("%s\n", opt->doc);
+             while (*doc && *doc != '\n')
+               grub_putchar (*doc++);
+             grub_putchar ('\n');
 
+             if (! *doc)
+               break;
+             doc++;
+             spacing = 4 + 20;
+           }
+
          switch (opt->shortarg)
            {
            case 'h':




Reply via email to