[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[7914] info_get_node_with_defaults
From: |
gavinsmith0123 |
Subject: |
[7914] info_get_node_with_defaults |
Date: |
Sun, 9 Jul 2017 13:57:40 -0400 (EDT) |
Revision: 7914
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7914
Author: gavin
Date: 2017-07-09 13:57:39 -0400 (Sun, 09 Jul 2017)
Log Message:
-----------
info_get_node_with_defaults
Modified Paths:
--------------
trunk/ChangeLog
trunk/info/nodes.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2017-07-09 17:23:09 UTC (rev 7913)
+++ trunk/ChangeLog 2017-07-09 17:57:39 UTC (rev 7914)
@@ -1,5 +1,11 @@
2017-07-09 Gavin Smith <address@hidden>
+ * info/nodes.c (info_get_node_with_defaults): Only use the
+ directory from the current node's fullpath if this function was
+ passed a filename as an argument.
+
+2017-07-09 Gavin Smith <address@hidden>
+
* info/nodes.c
(get_filename_and_nodename, info_get_node_with_defaults):
Merge get_filename_and_nodename into caller.
Modified: trunk/info/nodes.c
===================================================================
--- trunk/info/nodes.c 2017-07-09 17:23:09 UTC (rev 7913)
+++ trunk/info/nodes.c 2017-07-09 17:57:39 UTC (rev 7914)
@@ -923,7 +923,35 @@
filename = filename_in;
if (filename_in)
- filename = xstrdup (filename_in);
+ {
+ filename = xstrdup (filename_in);
+ if (follow_strategy == FOLLOW_REMAIN
+ && defaults && defaults->fullpath
+ && filename_in)
+ {
+ /* Find the directory in the filename for defaults, and look in
+ that directory first. */
+ char *file_in_same_dir;
+ char saved_char, *p;
+
+ p = defaults->fullpath + strlen (defaults->fullpath);
+ while (p > defaults->fullpath && !IS_SLASH (*p))
+ p--;
+
+ if (p > defaults->fullpath)
+ {
+ saved_char = *p;
+ *p = 0;
+
+ file_in_same_dir = info_add_extension (defaults->fullpath,
+ filename, 0);
+ if (file_in_same_dir)
+ file_buffer = info_find_file (file_in_same_dir);
+ free (file_in_same_dir);
+ *p = saved_char;
+ }
+ }
+ }
else
{
if (defaults)
@@ -952,33 +980,6 @@
goto cleanup_and_exit;
}
-
- if (follow_strategy == FOLLOW_REMAIN
- && defaults && defaults->fullpath)
- {
- /* Find the directory in the filename for defaults, and look in
- that directory first. */
- char *file_in_same_dir;
- char saved_char, *p;
-
- p = defaults->fullpath + strlen (defaults->fullpath);
- while (p > defaults->fullpath && !IS_SLASH (*p))
- p--;
-
- if (p > defaults->fullpath)
- {
- saved_char = *p;
- *p = 0;
-
- file_in_same_dir = info_add_extension (defaults->fullpath,
- filename, 0);
- if (file_in_same_dir)
- file_buffer = info_find_file (file_in_same_dir);
- free (file_in_same_dir);
- *p = saved_char;
- }
- }
-
if (!file_buffer)
file_buffer = info_find_file (filename);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [7914] info_get_node_with_defaults,
gavinsmith0123 <=