From ba994a14fdc759f4242ff0b28d5906aec87c74f9 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 31 Jan 2002 06:23:17 +0000 Subject: * chew.c (courierize): Don't modify @command params. --- bfd/doc/ChangeLog | 10 +++++++--- bfd/doc/chew.c | 48 +++++++++++++++++++++++++++++------------------- 2 files changed, 36 insertions(+), 22 deletions(-) (limited to 'bfd/doc') diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog index 2f3db6f..4116045 100644 --- a/bfd/doc/ChangeLog +++ b/bfd/doc/ChangeLog @@ -1,9 +1,13 @@ +2002-01-31 Alan Modra + + * chew.c (courierize): Don't modify @command params. + 2001-10-30 Hans-Peter Nilsson - * 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. diff --git a/bfd/doc/chew.c b/bfd/doc/chew.c index 843e441..42ab399 100644 --- a/bfd/doc/chew.c +++ b/bfd/doc/chew.c @@ -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'); } -- cgit v1.1