tweaks: improve three comments, drop one, and unwrap a line
parent
07b48024d1
commit
42ca89039a
|
@ -285,7 +285,7 @@ bool have_statedir(void)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Load the histories for Search and Replace and Execute Command. */
|
/* Load the histories for Search, Replace With, and Execute Command. */
|
||||||
void load_history(void)
|
void load_history(void)
|
||||||
{
|
{
|
||||||
char *histname = concatenate(statedir, SEARCH_HISTORY);
|
char *histname = concatenate(statedir, SEARCH_HISTORY);
|
||||||
|
@ -295,8 +295,7 @@ void load_history(void)
|
||||||
if (errno != ENOENT) {
|
if (errno != ENOENT) {
|
||||||
/* When reading failed, don't save history when we quit. */
|
/* When reading failed, don't save history when we quit. */
|
||||||
UNSET(HISTORYLOG);
|
UNSET(HISTORYLOG);
|
||||||
jot_error(N_("Error reading %s: %s"), histname,
|
jot_error(N_("Error reading %s: %s"), histname, strerror(errno));
|
||||||
strerror(errno));
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Load the three history lists -- first search, then replace,
|
/* Load the three history lists -- first search, then replace,
|
||||||
|
@ -310,7 +309,6 @@ void load_history(void)
|
||||||
while ((read = getline(&line, &buf_len, hisfile)) > 0) {
|
while ((read = getline(&line, &buf_len, hisfile)) > 0) {
|
||||||
line[--read] = '\0';
|
line[--read] = '\0';
|
||||||
if (read > 0) {
|
if (read > 0) {
|
||||||
/* Encode any embedded NUL as 0x0A. */
|
|
||||||
recode_NUL_to_LF(line, read);
|
recode_NUL_to_LF(line, read);
|
||||||
update_history(history, line);
|
update_history(history, line);
|
||||||
} else if (history == &search_history)
|
} else if (history == &search_history)
|
||||||
|
@ -323,7 +321,7 @@ void load_history(void)
|
||||||
free(line);
|
free(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* After reading them in, set the status of the lists to "unchanged". */
|
/* Reading in the lists has marked them as changed; undo this side effect. */
|
||||||
history_changed = FALSE;
|
history_changed = FALSE;
|
||||||
|
|
||||||
free(histname);
|
free(histname);
|
||||||
|
@ -350,7 +348,7 @@ bool write_list(const linestruct *head, FILE *hisfile)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save the histories for Search and Replace and Execute Command. */
|
/* Save the histories for Search, Replace With, and Execute Command. */
|
||||||
void save_history(void)
|
void save_history(void)
|
||||||
{
|
{
|
||||||
char *histname;
|
char *histname;
|
||||||
|
|
Loading…
Reference in New Issue