~ubuntu-branches/debian/lenny/texinfo/lenny

« back to all changes in this revision

Viewing changes to info/nodes.c

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2008-02-20 08:24:18 UTC
  • mfrom: (3.1.4 hardy)
  • Revision ID: james.westby@ubuntu.com-20080220082418-v0mwknqadr1gzkzm
Tags: 4.11.dfsg.1-4
fix bashism in texi2dvi (Closes: #461352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* nodes.c -- how to get an Info file and node.
2
 
   $Id: nodes.c,v 1.4 2004/04/11 17:56:46 karl Exp $
3
 
 
4
 
   Copyright (C) 1993, 1998, 1999, 2000, 2002, 2003, 2004 Free Software
5
 
   Foundation, Inc.
6
 
 
7
 
   This program is free software; you can redistribute it and/or modify
 
2
   $Id: nodes.c,v 1.9 2007/07/01 21:20:30 karl Exp $
 
3
 
 
4
   Copyright (C) 1993, 1998, 1999, 2000, 2002, 2003, 2004, 2006, 2007
 
5
   Free Software Foundation, Inc.
 
6
 
 
7
   This program is free software: you can redistribute it and/or modify
8
8
   it under the terms of the GNU General Public License as published by
9
 
   the Free Software Foundation; either version 2, or (at your option)
10
 
   any later version.
 
9
   the Free Software Foundation, either version 3 of the License, or
 
10
   (at your option) any later version.
11
11
 
12
12
   This program is distributed in the hope that it will be useful,
13
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
   GNU General Public License for more details.
16
16
 
17
17
   You should have received a copy of the GNU General Public License
18
 
   along with this program; if not, write to the Free Software
19
 
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
18
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
19
 
21
20
   Originally written by Brian Fox (bfox@ai.mit.edu). */
22
21
 
116
115
  /* Look for the node.  */
117
116
  node = info_get_node_of_file_buffer (nodename, file_buffer);
118
117
 
119
 
  /* If the node not found was "Top", try again with different case.  */
120
 
  if (!node && (nodename == NULL || strcasecmp (nodename, "Top") == 0))
 
118
  /* If the node not found was "Top", try again with different case,
 
119
     unless this was a man page.  */
 
120
  if (!node
 
121
      && strcasecmp (filename, MANPAGE_FILE_BUFFER_NAME) != 0
 
122
      && (nodename == NULL || strcasecmp (nodename, "Top") == 0))
121
123
    {
122
124
      node = info_get_node_of_file_buffer ("Top", file_buffer);
123
125
      if (!node)
137
139
info_get_node_of_file_buffer (char *nodename, FILE_BUFFER *file_buffer)
138
140
{
139
141
  NODE *node = NULL;
 
142
  int implicit_nodename = 0;
140
143
 
141
144
  /* If we are unable to find the file, we have to give up.  There isn't
142
145
     anything else we can do. */
149
152
 
150
153
  /* If NODENAME is not specified, it defaults to "Top". */
151
154
  if (!nodename)
152
 
    nodename = "Top";
 
155
    {
 
156
      nodename = "Top";
 
157
      implicit_nodename = 1;  /* don't return man page for top */
 
158
    }
153
159
 
154
160
  /* If the name of the node that we wish to find is exactly "*", then the
155
161
     node body is the contents of the entire file.  Create and return such
168
174
#if defined (HANDLE_MAN_PAGES)
169
175
  /* If the file buffer is the magic one associated with manpages, call
170
176
     the manpage node finding function instead. */
171
 
  else if (file_buffer->flags & N_IsManPage)
 
177
  else if (!implicit_nodename && file_buffer->flags & N_IsManPage)
172
178
    {
173
 
        node = get_manpage_node (file_buffer, nodename);
 
179
      node = get_manpage_node (file_buffer, nodename);
174
180
    }
175
181
#endif /* HANDLE_MAN_PAGES */
176
182
  /* If this is the "main" info file, it might contain a tags table.  Search