Commit 2bcc6d7f authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: start searching at a better place

Taking the terminating newline into account, and that there is
at least one digit per number.
No related merge requests found
Showing with 5 additions and 5 deletions
+5 -5
...@@ -3186,13 +3186,13 @@ void load_poshistory(void) ...@@ -3186,13 +3186,13 @@ void load_poshistory(void)
poshiststruct *record_ptr = NULL, *newrecord; poshiststruct *record_ptr = NULL, *newrecord;
/* Read and parse each line, and store the extracted data. */ /* Read and parse each line, and store the extracted data. */
while ((read = getline(&line, &buf_len, hist)) > 2) { while ((read = getline(&line, &buf_len, hist)) > 5) {
/* Decode nulls as newlines. */ /* Decode nulls as embedded newlines. */
unsunder(line, read); unsunder(line, read);
/* Find where x index and line number are in the line. */ /* Find where the x index and line number are in the line. */
xptr = revstrstr(line, " ", line + read); xptr = revstrstr(line, " ", line + read - 3);
lineptr = revstrstr(line, " ", xptr - 1); lineptr = revstrstr(line, " ", xptr - 2);
/* Now separate the three elements of the line. */ /* Now separate the three elements of the line. */
*(xptr++) = '\0'; *(xptr++) = '\0';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment