history: search for the two position numbers from EOL instead of BOL
A filename might contain spaces, so we can't look for the numbers (the second and third elements) starting from the head of the line -- we have to start at the tail and work backward. This fixes https://savannah.gnu.org/bugs/?49879.master
parent
bc8a3a50a4
commit
ecd18c1694
|
@ -3190,8 +3190,13 @@ void load_poshistory(void)
|
||||||
/* Decode nulls as newlines. */
|
/* Decode nulls as newlines. */
|
||||||
unsunder(line, read);
|
unsunder(line, read);
|
||||||
|
|
||||||
lineptr = parse_next_word(line);
|
/* Find where x index and line number are in the line. */
|
||||||
xptr = parse_next_word(lineptr);
|
xptr = revstrstr(line, " ", line + read);
|
||||||
|
lineptr = revstrstr(line, " ", xptr - 1);
|
||||||
|
|
||||||
|
/* Now separate the three elements of the line. */
|
||||||
|
*(xptr++) = '\0';
|
||||||
|
*(lineptr++) = '\0';
|
||||||
|
|
||||||
/* Create a new position record. */
|
/* Create a new position record. */
|
||||||
newrecord = (poshiststruct *)nmalloc(sizeof(poshiststruct));
|
newrecord = (poshiststruct *)nmalloc(sizeof(poshiststruct));
|
||||||
|
|
Loading…
Reference in New Issue