2007-12-29 Bruno Haible
* makeinfo/node.c (remember_node): Give a warning when the node name does not satisfy the documented constraints. *** texinfo-4.11/makeinfo/node.c.bak 2007-07-08 15:11:48.000000000 +0200 --- texinfo-4.11/makeinfo/node.c 2007-12-30 02:45:33.000000000 +0100 *************** *** 280,285 **** --- 280,319 ---- node, tag->line_no); return; } + /* The documentation says: "You cannot use periods, commas, colons or + parentheses within a node name." */ + if (strchr (node, '(') != NULL || strchr (node, ')') != NULL) + { + warning (_("Node name `%s' contains a parenthesis"), node); + } + if (strchr (node, ':') != NULL) + { + warning (_("Node name `%s' contains a colon"), node); + } + if (strchr (node, ',') != NULL) + { + warning (_("Node name `%s' contains a comma"), node); + } + /* periods are only dangerous - see info/node.c function + skip_node_characters - when at the start of the node name or + when followed by whitespace, newline, or ')'. */ + if (*node == '.') + { + warning (_("Node name `%s' starts with a period"), node); + } + { + const char *np; + + for (np = node; *np != '\0'; np++) + if (*np == '.' + && (np[1] == ' ' || np[1] == '\t' || np[1] == '\n' + || np[1] == ')')) + { + warning (_("Node name `%s' contains a period followed by whitespace or a closing parenthesis"), + node); + break; + } + } } if (!(flags & TAG_FLAG_ANCHOR))