[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[5534] avoid window with no node; relative path with --file test
From: |
Gavin D. Smith |
Subject: |
[5534] avoid window with no node; relative path with --file test |
Date: |
Thu, 08 May 2014 11:35:35 +0000 |
Revision: 5534
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5534
Author: gavin
Date: 2014-05-08 11:35:31 +0000 (Thu, 08 May 2014)
Log Message:
-----------
avoid window with no node; relative path with --file test
Modified Paths:
--------------
trunk/ChangeLog
trunk/info/Makefile.am
trunk/info/filesys.h
trunk/info/session.c
Added Paths:
-----------
trunk/info/t/file-relative-path.sh
trunk/info/t/infodir/quoting.info
trunk/info/t/relative-path.sh
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2014-05-08 10:43:19 UTC (rev 5533)
+++ trunk/ChangeLog 2014-05-08 11:35:31 UTC (rev 5534)
@@ -1,5 +1,15 @@
2014-05-08 Gavin Smith <address@hidden>
+ * info/session.c (begin_multiple_window_info_session): Deal with
+ references to desired nodes being invalid and display dir node
+ as a back-up.
+
+ * info/filesys.h (DEFAULT_INFOPATH): "." moved to end of path.
+
+ * info/t/file-relative-path.sh: New test.
+
+2014-05-08 Gavin Smith <address@hidden>
+
* info/t/Init-intera.inc: Redirect stdin as well as stdout and stderr.
* info/t (all files): Look in $srcdir for test data to faciliate
VPATH builds.
Modified: trunk/info/Makefile.am
===================================================================
--- trunk/info/Makefile.am 2014-05-08 10:43:19 UTC (rev 5533)
+++ trunk/info/Makefile.am 2014-05-08 11:35:31 UTC (rev 5534)
@@ -96,6 +96,7 @@
t/no-file.sh \
t/split.sh \
t/relative-path.sh \
+ t/file-relative-path.sh \
t/dir.sh \
t/dir-file.sh \
t/dir-nondir.sh \
Modified: trunk/info/filesys.h
===================================================================
--- trunk/info/filesys.h 2014-05-08 10:43:19 UTC (rev 5533)
+++ trunk/info/filesys.h 2014-05-08 11:35:31 UTC (rev 5534)
@@ -79,7 +79,7 @@
/* The default value of INFOPATH. */
#if !defined (DEFAULT_INFOPATH)
-# define DEFAULT_INFOPATH
".:PATH:/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:/usr/local/lib/emacs/info:/usr/local/emacs/info"
+# define DEFAULT_INFOPATH
"PATH:/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:/usr/local/lib/emacs/info:/usr/local/emacs/info:."
#endif /* !DEFAULT_INFOPATH */
#if !defined (S_ISREG) && defined (S_IFREG)
Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c 2014-05-08 10:43:19 UTC (rev 5533)
+++ trunk/info/session.c 2014-05-08 11:35:31 UTC (rev 5534)
@@ -104,27 +104,16 @@
else
show_error_node (error);
- /* Load dir node as a back-up. */
- if (!references || !references[0])
+ for (i = 0; references && references[i]; i++)
{
- /* Used to build `dir' menu from `localdir' files found in INFOPATH. */
- extern NODE *dir_node (void);
-
- NODE *node;
-
- node = dir_node ();
- info_set_node_of_window (active_window, node);
- return;
- }
-
- for (i = 0; references[i]; i++)
- {
NODE *node;
if (!window)
{
window = active_window;
info_select_reference (window, references[i]);
+ if (!window->node)
+ window = 0;
}
else
{
@@ -152,6 +141,14 @@
active_window = largest;
window = window_make_window (0);
info_select_reference (window, references[i]);
+
+ if (!window->node)
+ {
+ /* We couldn't find the node referenced. */
+ window_delete_window (window);
+ window = 0;
+ }
+
if (window)
{
window_tile_windows (TILE_INTERNALS);
@@ -165,6 +162,20 @@
}
}
}
+
+ /* Load dir node as a back-up if there were no references given, or if
+ none of them were valid. */
+ if (!window)
+ {
+ /* Used to build `dir' menu from `localdir' files found in INFOPATH. */
+ extern NODE *dir_node (void);
+
+ NODE *node;
+
+ node = dir_node ();
+ info_set_node_of_window (active_window, node);
+ return;
+ }
}
void
Added: trunk/info/t/file-relative-path.sh
===================================================================
--- trunk/info/t/file-relative-path.sh (rev 0)
+++ trunk/info/t/file-relative-path.sh 2014-05-08 11:35:31 UTC (rev 5534)
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# 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 3, 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
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# 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, see <http://www.gnu.org/licenses/>.
+
+. t/Init-test.inc
+
+# Load a file given relative to the current directory using --file.
+$GINFO --output - --file t/infodir/sample.info | grep "^File: sample.info,"
Property changes on: trunk/info/t/file-relative-path.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/info/t/infodir/quoting.info
===================================================================
(Binary files differ)
Property changes on: trunk/info/t/infodir/quoting.info
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/info/t/relative-path.sh
===================================================================
--- trunk/info/t/relative-path.sh (rev 0)
+++ trunk/info/t/relative-path.sh 2014-05-08 11:35:31 UTC (rev 5534)
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# 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 3, 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
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# 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, see <http://www.gnu.org/licenses/>.
+
+. t/Init-test.inc
+
+# Load a file given relative to the current directory without using
+# --file.
+$GINFO --output - t/infodir/sample.info | grep "^File: sample.info,"
Property changes on: trunk/info/t/relative-path.sh
___________________________________________________________________
Added: svn:executable
+ *
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [5534] avoid window with no node; relative path with --file test,
Gavin D. Smith <=