]> git.wh0rd.org Git - nano.git/commitdiff
Handling an update of the first element correctly.
authorBenno Schulenberg <bensberg@justemail.net>
Mon, 25 Jan 2016 20:26:01 +0000 (20:26 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Mon, 25 Jan 2016 20:26:01 +0000 (20:26 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5589 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/files.c

index c495de5cf08c623c59ad512fb63e7970685b6e8e..70f1b985dd164d4f8789331d8f9cff6919f49e57 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-01-25  Benno Schulenberg  <bensberg@justemail.net>
+       * src/files.c (update_poshistory): Handle an update of the first
+       element correctly.
+
 2016-01-24  Benno Schulenberg  <bensberg@justemail.net>
        * src/files.c (update_poshistory): Move an updated item to the end
        of the list, so that it won't be dropped any time soon.  The problem
index 51e9c9cfb1dcd17c916cedc70b9091ca501f0561..29e7ab6c862ce813c02287a87138f1dd81236384 100644 (file)
@@ -3208,7 +3208,10 @@ void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos)
        else
            posprev->next = theone;
     } else if (posptr->next != NULL) {
-       posprev->next = posptr->next;
+       if (posprev == NULL)
+           position_history = posptr->next;
+       else
+           posprev->next = posptr->next;
        while (posptr->next != NULL)
            posptr = posptr->next;
        posptr->next = theone;