summaryrefslogtreecommitdiff
path: root/makeinfo/tests/menu-whitespace
blob: a01a38d5c04ba7e459b0668d8a117a008b3c2598 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
# Bug where whitespace after @menu caused confusion.

unset TEXINFO_OUTPUT
: ${srcdir=.}
input=`basename $0`.txi

../makeinfo -o /dev/null $srcdir/$input
exit $?

Date: 07 Dec 1998 11:23:44 +0100
From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
To: bug-texinfo@gnu.org
Subject: Makeinfo mishandles defaulted node links

The following example demonstrates a bug in makeinfo:

$ cat top.texi
@setfilename top.info

@node Top
@top Top

@menu
* first::
@end menu

@node first
@chapter first

@menu   @c
* second::
@end menu

@node second
@section second
$ makeinfo top.texi
Making info file `top.info' from `top.texi'.
./top.texi:3: Next field of node `Top' not pointed to.
./top.texi:17: This node (second) has the bad Prev.
makeinfo: Removing output file `/home/as/test/top.info' due to errors; use --force to preserve.

Makeinfo is being confused by the whitespace after @menu, or rather by its
absence.


1998-12-06  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

	* makeinfo/node.c (cm_node): When searching for @menu don't
	require a space after it.

--- texinfo-3.12b/makeinfo/node.c.~1~	Mon Oct 26 23:14:59 1998
+++ texinfo-3.12b/makeinfo/node.c	Sun Dec  6 00:23:59 1998
@@ -523,9 +523,10 @@
                     orig_size = size_of_input_text;
 
                   input_text_offset =
-                    search_forward ("\n@menu ", orig_offset);
+                    search_forward ("\n@menu", orig_offset);
 
-                  if (input_text_offset > -1)
+                  if (input_text_offset > -1
+		      && cr_or_whitespace (input_text[input_text_offset + 6]))
                     {
                       char *nodename_from_menu = NULL;
 

-- 
Andreas Schwab                                      "And now for something
schwab@issan.cs.uni-dortmund.de                      completely different"
schwab@gnu.org