menu-whitespace 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/sh
  2. # $Id: menu-whitespace,v 1.3 2010-12-04 00:05:54 karl Exp $
  3. # Public domain. Bug where whitespace after @menu caused confusion.
  4. unset TEXINFO_OUTPUT LANG LANGUAGE
  5. LC_ALL=POSIX; export LC_ALL
  6. : ${srcdir=.}
  7. input=`basename $0`.txi
  8. ../makeinfo -o /dev/null $srcdir/$input
  9. exit $?
  10. Date: 07 Dec 1998 11:23:44 +0100
  11. From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
  12. To: bug-texinfo@gnu.org
  13. Subject: Makeinfo mishandles defaulted node links
  14. The following example demonstrates a bug in makeinfo:
  15. $ cat top.texi
  16. @setfilename top.info
  17. @node Top
  18. @top Top
  19. @menu
  20. * first::
  21. @end menu
  22. @node first
  23. @chapter first
  24. @menu @c
  25. * second::
  26. @end menu
  27. @node second
  28. @section second
  29. $ makeinfo top.texi
  30. Making info file `top.info' from `top.texi'.
  31. ./top.texi:3: Next field of node `Top' not pointed to.
  32. ./top.texi:17: This node (second) has the bad Prev.
  33. makeinfo: Removing output file `/home/as/test/top.info' due to errors; use --force to preserve.
  34. Makeinfo is being confused by the whitespace after @menu, or rather by its
  35. absence.
  36. 1998-12-06 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
  37. * makeinfo/node.c (cm_node): When searching for @menu don't
  38. require a space after it.
  39. --- texinfo-3.12b/makeinfo/node.c.~1~ Mon Oct 26 23:14:59 1998
  40. +++ texinfo-3.12b/makeinfo/node.c Sun Dec 6 00:23:59 1998
  41. @@ -523,9 +523,10 @@
  42. orig_size = size_of_input_text;
  43. input_text_offset =
  44. - search_forward ("\n@menu ", orig_offset);
  45. + search_forward ("\n@menu", orig_offset);
  46. - if (input_text_offset > -1)
  47. + if (input_text_offset > -1
  48. + && cr_or_whitespace (input_text[input_text_offset + 6]))
  49. {
  50. char *nodename_from_menu = NULL;
  51. --
  52. Andreas Schwab "And now for something
  53. schwab@issan.cs.uni-dortmund.de completely different"
  54. schwab@gnu.org