summaryrefslogtreecommitdiff
path: root/Build/source/utils/texinfo/info/nodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/texinfo/info/nodes.c')
-rw-r--r--Build/source/utils/texinfo/info/nodes.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/Build/source/utils/texinfo/info/nodes.c b/Build/source/utils/texinfo/info/nodes.c
index a3381a83145..a0b95411609 100644
--- a/Build/source/utils/texinfo/info/nodes.c
+++ b/Build/source/utils/texinfo/info/nodes.c
@@ -1,13 +1,13 @@
/* nodes.c -- how to get an Info file and node.
- $Id: nodes.c,v 1.4 2004/04/11 17:56:46 karl Exp $
+ $Id: nodes.c,v 1.10 2007/12/03 01:38:43 karl Exp $
- Copyright (C) 1993, 1998, 1999, 2000, 2002, 2003, 2004 Free Software
- Foundation, Inc.
+ Copyright (C) 1993, 1998, 1999, 2000, 2002, 2003, 2004, 2006, 2007
+ Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,8 +15,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
Originally written by Brian Fox (bfox@ai.mit.edu). */
@@ -116,8 +115,11 @@ info_get_node (char *filename, char *nodename)
/* Look for the node. */
node = info_get_node_of_file_buffer (nodename, file_buffer);
- /* If the node not found was "Top", try again with different case. */
- if (!node && (nodename == NULL || strcasecmp (nodename, "Top") == 0))
+ /* If the node not found was "Top", try again with different case,
+ unless this was a man page. */
+ if (!node
+ && mbscasecmp (filename, MANPAGE_FILE_BUFFER_NAME) != 0
+ && (nodename == NULL || mbscasecmp (nodename, "Top") == 0))
{
node = info_get_node_of_file_buffer ("Top", file_buffer);
if (!node)
@@ -137,6 +139,7 @@ NODE *
info_get_node_of_file_buffer (char *nodename, FILE_BUFFER *file_buffer)
{
NODE *node = NULL;
+ int implicit_nodename = 0;
/* If we are unable to find the file, we have to give up. There isn't
anything else we can do. */
@@ -149,7 +152,10 @@ info_get_node_of_file_buffer (char *nodename, FILE_BUFFER *file_buffer)
/* If NODENAME is not specified, it defaults to "Top". */
if (!nodename)
- nodename = "Top";
+ {
+ nodename = "Top";
+ implicit_nodename = 1; /* don't return man page for top */
+ }
/* If the name of the node that we wish to find is exactly "*", then the
node body is the contents of the entire file. Create and return such
@@ -168,9 +174,9 @@ info_get_node_of_file_buffer (char *nodename, FILE_BUFFER *file_buffer)
#if defined (HANDLE_MAN_PAGES)
/* If the file buffer is the magic one associated with manpages, call
the manpage node finding function instead. */
- else if (file_buffer->flags & N_IsManPage)
+ else if (!implicit_nodename && file_buffer->flags & N_IsManPage)
{
- node = get_manpage_node (file_buffer, nodename);
+ node = get_manpage_node (file_buffer, nodename);
}
#endif /* HANDLE_MAN_PAGES */
/* If this is the "main" info file, it might contain a tags table. Search
@@ -288,7 +294,7 @@ info_find_file_internal (char *filename, int get_tags)
#if defined (HANDLE_MAN_PAGES)
/* If the name of the file that we want is our special file buffer for
Unix manual pages, then create the file buffer, and return it now. */
- if (strcasecmp (filename, MANPAGE_FILE_BUFFER_NAME) == 0)
+ if (mbscasecmp (filename, MANPAGE_FILE_BUFFER_NAME) == 0)
file_buffer = create_manpage_file_buffer ();
else
#endif /* HANDLE_MAN_PAGES */
@@ -325,7 +331,7 @@ info_load_file_internal (char *filename, int get_tags)
doesn't exist, then try again with the last part of the filename
appearing in lowercase. */
/* This is probably not needed at all on those systems which define
- FILENAME_CMP to be strcasecmp. But let's do it anyway, lest some
+ FILENAME_CMP to be mbscasecmp. But let's do it anyway, lest some
network redirector supports case sensitivity. */
if (retcode < 0)
{