[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[7798] replace_in_documentation changes for clarity
From: |
gavinsmith0123 |
Subject: |
[7798] replace_in_documentation changes for clarity |
Date: |
Sat, 20 May 2017 07:41:27 -0400 (EDT) |
Revision: 7798
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7798
Author: gavin
Date: 2017-05-20 07:41:27 -0400 (Sat, 20 May 2017)
Log Message:
-----------
replace_in_documentation changes for clarity
Modified Paths:
--------------
trunk/ChangeLog
trunk/info/infodoc.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2017-05-19 21:11:40 UTC (rev 7797)
+++ trunk/ChangeLog 2017-05-20 11:41:27 UTC (rev 7798)
@@ -1,3 +1,13 @@
+2017-05-20 Gavin Smith <address@hidden>
+
+ * info/infodoc.c (replace_in_documentation): Explicitly compare
+ a pointed-to character to the only character value it can be
+ equal to other than null, for clarity. Move code near other
+ code that uses the same variables. Change comment for a special
+ case to make it easier to ignore, and move the default case
+ before the conditional for the special case. No functional
+ changes.
+
2017-05-19 Gavin Smith <address@hidden>
* info/infodoc.c (replace_in_documentation):
Modified: trunk/info/infodoc.c
===================================================================
--- trunk/info/infodoc.c 2017-05-19 21:11:40 UTC (rev 7797)
+++ trunk/info/infodoc.c 2017-05-20 11:41:27 UTC (rev 7798)
@@ -702,18 +702,24 @@
strncpy (rep_name, string + start, i - start);
rep_name[i - start] = '\0';
- /* If we have only one window (because the window size was too
- small to split it), we have to quit help by going back one
- node in the history list, not deleting the window. */
+ start = i;
+ if (string[start] == ']')
+ start++;
+
+ fun_name = rep_name;
if (strcmp (rep_name, "quit-help") == 0)
- fun_name = help_is_only_window_p ? "history-node"
- : "get-help-window";
- else
- fun_name = rep_name;
+ {
+ /* Special case for help window. If we have only one window
+ (because the window size was too small to split it), we
+ have to quit help by going back one node in the history
+ list, not deleting the window. */
+ fun_name = help_is_only_window_p ? "history-node"
+ : "get-help-window";
+ }
+
/* Find a key which invokes this function in the info_keymap. */
command = named_function (fun_name);
-
free (rep_name);
/* If the internal documentation string fails, there is a
@@ -746,10 +752,6 @@
strcpy (result + next, rep);
next = strlen (result);
-
- start = i;
- if (string[i])
- start++;
}
free (fmt);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [7798] replace_in_documentation changes for clarity,
gavinsmith0123 <=