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