commit 2bcc6d7f6696fcb6799ea64389b944d61fa0c3e4
parent cd705a7c4c3db6c8ed7395c85e76ff7edc9ff6b1
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Mon, 19 Dec 2016 09:52:30 +0100
tweaks: start searching at a better place
Taking the terminating newline into account, and that there is
at least one digit per number.
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -3186,13 +3186,13 @@ void load_poshistory(void)
poshiststruct *record_ptr = NULL, *newrecord;
/* Read and parse each line, and store the extracted data. */
- while ((read = getline(&line, &buf_len, hist)) > 2) {
- /* Decode nulls as newlines. */
+ while ((read = getline(&line, &buf_len, hist)) > 5) {
+ /* Decode nulls as embedded newlines. */
unsunder(line, read);
- /* Find where x index and line number are in the line. */
- xptr = revstrstr(line, " ", line + read);
- lineptr = revstrstr(line, " ", xptr - 1);
+ /* Find where the x index and line number are in the line. */
+ xptr = revstrstr(line, " ", line + read - 3);
+ lineptr = revstrstr(line, " ", xptr - 2);
/* Now separate the three elements of the line. */
*(xptr++) = '\0';