* chew.c (courierize): Don't modify @command params.
authorAlan Modra <amodra@gmail.com>
Thu, 31 Jan 2002 06:23:17 +0000 (06:23 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 31 Jan 2002 06:23:17 +0000 (06:23 +0000)
bfd/doc/ChangeLog
bfd/doc/chew.c

index 2f3db6f58e1ebf5106ba5d121c3b095dfb2c95e8..41160450caf1f32fd74697f7cf7f35f5bf2c87a5 100644 (file)
@@ -1,9 +1,13 @@
+2002-01-31  Alan Modra  <amodra@bigpond.net.au>
+
+       * chew.c (courierize): Don't modify @command params.
+
 2001-10-30  Hans-Peter Nilsson  <hp@bitrange.com>
 
-       * doc/bfdint.texi (BFD target vector miscellaneous): Add
+       * bfdint.texi (BFD target vector miscellaneous): Add
        bfd_target_mmo_flavour.
-       * doc/bfd.texinfo (BFD back ends): Add entry for mmo.
-       * doc/Makefile.am (DOCFILES): Add mmo.texi.
+       * bfd.texinfo (BFD back ends): Add entry for mmo.
+       * Makefile.am (DOCFILES): Add mmo.texi.
        (SRCDOC): Add mmo.c.
        (s-mmo, mmo.texi): New rules.
 
index 843e44140376a561823d75a33f50015f243cdd1d..42ab3993b0e02e1c651ab9fdbf7eca130e42cfbe 100644 (file)
@@ -686,37 +686,47 @@ WORD (courierize)
 
              while (at (tos, idx) && at (tos, idx) != '\n')
                {
-                 if (at (tos, idx) == '{' && at (tos, idx + 1) == '*')
+                 if (command > 1)
+                   {
+                     /* We are inside {} parameters of some command;
+                        Just pass through until matching brace.  */
+                     if (at (tos, idx) == '{')
+                       ++command;
+                     else if (at (tos, idx) == '}')
+                       --command;
+                   }
+                 else if (command != 0)
+                   {
+                     if (at (tos, idx) == '{')
+                       ++command;
+                     else if (!islower ((unsigned char) at (tos, idx)))
+                       --command;
+                   }
+                 else if (at (tos, idx) == '@'
+                          && islower ((unsigned char) at (tos, idx + 1)))
+                   {
+                     ++command;
+                   }
+                 else if (at (tos, idx) == '{' && at (tos, idx + 1) == '*')
                    {
                      cattext (&out, "/*");
                      idx += 2;
+                     continue;
                    }
                  else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}')
                    {
                      cattext (&out, "*/");
                      idx += 2;
+                     continue;
                    }
-                 else if (at (tos, idx) == '{' && !command)
+                 else if (at (tos, idx) == '{'
+                          || at (tos, idx) == '}')
                    {
-                     cattext (&out, "@{");
-                     idx++;
-                   }
-                 else if (at (tos, idx) == '}' && !command)
-                   {
-                     cattext (&out, "@}");
-                     idx++;
-                   }
-                 else
-                   {
-                     if (at (tos, idx) == '@')
-                       command = 1;
-                     else if (isspace ((unsigned char) at (tos, idx))
-                              || at (tos, idx) == '}')
-                       command = 0;
-                     catchar (&out, at (tos, idx));
-                     idx++;
+                     catchar (&out, '@');
                    }
 
+                 catchar (&out, at (tos, idx));
+                 idx++;
                }
              catchar (&out, '\n');
            }