history: don't bother encoding search items -- they cannot contain newlines

master
Benno Schulenberg 2016-12-18 17:42:39 +01:00
parent f915a28d30
commit 8b483c10ba
1 changed files with 0 additions and 3 deletions

View File

@ -2966,7 +2966,6 @@ void load_history(void)
if (read > 0 && line[read - 1] == '\n') if (read > 0 && line[read - 1] == '\n')
line[--read] = '\0'; line[--read] = '\0';
if (read > 0) { if (read > 0) {
unsunder(line, read);
update_history(history, line); update_history(history, line);
} else } else
history = &replace_history; history = &replace_history;
@ -2992,8 +2991,6 @@ bool writehist(FILE *hist, filestruct *h)
for (p = h; p != NULL; p = p->next) { for (p = h; p != NULL; p = p->next) {
size_t p_len = strlen(p->data); size_t p_len = strlen(p->data);
sunder(p->data);
if (fwrite(p->data, sizeof(char), p_len, hist) < p_len || if (fwrite(p->data, sizeof(char), p_len, hist) < p_len ||
putc('\n', hist) == EOF) putc('\n', hist) == EOF)
return FALSE; return FALSE;