xref: /openbsd-src/gnu/usr.bin/texinfo/makeinfo/tests/menu-whitespace (revision a1acfa9b69ad64eb720639240c8438f11107dc85)
11cc83814Sespie#!/bin/sh
23fb98d4aSespie# Bug where whitespace after @menu caused confusion.
31cc83814Sespie
4*a1acfa9bSespieunset TEXINFO_OUTPUT
51cc83814Sespie: ${srcdir=.}
61cc83814Sespieinput=`basename $0`.txi
71cc83814Sespie
81cc83814Sespie../makeinfo -o /dev/null $srcdir/$input
91cc83814Sespieexit $?
101cc83814Sespie
111cc83814SespieDate: 07 Dec 1998 11:23:44 +0100
121cc83814SespieFrom: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
131cc83814SespieTo: bug-texinfo@gnu.org
141cc83814SespieSubject: Makeinfo mishandles defaulted node links
151cc83814Sespie
161cc83814SespieThe following example demonstrates a bug in makeinfo:
171cc83814Sespie
181cc83814Sespie$ cat top.texi
191cc83814Sespie@setfilename top.info
201cc83814Sespie
211cc83814Sespie@node Top
221cc83814Sespie@top Top
231cc83814Sespie
241cc83814Sespie@menu
251cc83814Sespie* first::
261cc83814Sespie@end menu
271cc83814Sespie
281cc83814Sespie@node first
291cc83814Sespie@chapter first
301cc83814Sespie
311cc83814Sespie@menu   @c
321cc83814Sespie* second::
331cc83814Sespie@end menu
341cc83814Sespie
351cc83814Sespie@node second
361cc83814Sespie@section second
371cc83814Sespie$ makeinfo top.texi
381cc83814SespieMaking info file `top.info' from `top.texi'.
391cc83814Sespie./top.texi:3: Next field of node `Top' not pointed to.
401cc83814Sespie./top.texi:17: This node (second) has the bad Prev.
411cc83814Sespiemakeinfo: Removing output file `/home/as/test/top.info' due to errors; use --force to preserve.
421cc83814Sespie
431cc83814SespieMakeinfo is being confused by the whitespace after @menu, or rather by its
441cc83814Sespieabsence.
451cc83814Sespie
461cc83814Sespie
471cc83814Sespie1998-12-06  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
481cc83814Sespie
491cc83814Sespie	* makeinfo/node.c (cm_node): When searching for @menu don't
501cc83814Sespie	require a space after it.
511cc83814Sespie
521cc83814Sespie--- texinfo-3.12b/makeinfo/node.c.~1~	Mon Oct 26 23:14:59 1998
531cc83814Sespie+++ texinfo-3.12b/makeinfo/node.c	Sun Dec  6 00:23:59 1998
541cc83814Sespie@@ -523,9 +523,10 @@
551cc83814Sespie                     orig_size = size_of_input_text;
561cc83814Sespie
571cc83814Sespie                   input_text_offset =
581cc83814Sespie-                    search_forward ("\n@menu ", orig_offset);
591cc83814Sespie+                    search_forward ("\n@menu", orig_offset);
601cc83814Sespie
611cc83814Sespie-                  if (input_text_offset > -1)
621cc83814Sespie+                  if (input_text_offset > -1
631cc83814Sespie+		      && cr_or_whitespace (input_text[input_text_offset + 6]))
641cc83814Sespie                     {
651cc83814Sespie                       char *nodename_from_menu = NULL;
661cc83814Sespie
671cc83814Sespie
681cc83814Sespie--
691cc83814SespieAndreas Schwab                                      "And now for something
701cc83814Sespieschwab@issan.cs.uni-dortmund.de                      completely different"
711cc83814Sespieschwab@gnu.org
721cc83814Sespie
73