]> git.wh0rd.org Git - nano.git/commitdiff
Not adding directories to the list of file positions.
authorBenno Schulenberg <bensberg@justemail.net>
Tue, 26 Jan 2016 09:06:31 +0000 (09:06 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Tue, 26 Jan 2016 09:06:31 +0000 (09:06 +0000)
This fixes Savannah bug #46971.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5592 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/files.c

index 7747efde7c7692c6445b73f2867fdb771f19b805..e69e31dc4034d724994d447ca7e67a297b606459 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-01-26  Benno Schulenberg  <bensberg@justemail.net>
+       * src/files.c (update_poshistory): Do not add directories to the
+       list of file positions.  This fixes Savannah bug #46971.
+
 2016-01-25  Benno Schulenberg  <bensberg@justemail.net>
        * src/files.c (update_poshistory): Handle an update of the first
        element correctly.
index 29e7ab6c862ce813c02287a87138f1dd81236384..d9533d9daf8b5447e97ec0d113613304574682a2 100644 (file)
@@ -3186,7 +3186,7 @@ void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos)
     poshiststruct *posptr, *theone, *posprev = NULL;
     char *fullpath = get_full_path(filename);
 
-    if (fullpath == NULL)
+    if (fullpath == NULL || fullpath[strlen(fullpath) - 1] == '/')
        return;
 
     /* Look for a matching filename in the list. */