]> git.wh0rd.org Git - nano.git/commitdiff
fix still *more* backup_lines() breakage
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Thu, 10 Nov 2005 03:40:45 +0000 (03:40 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Thu, 10 Nov 2005 03:40:45 +0000 (03:40 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3140 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

src/text.c

index 83afd0d62d011ff9c31df3a9d4a8fac442ca71e6..6cea181299d4ac6bccbc0a8fe7e39bace566ce49 100644 (file)
@@ -1002,7 +1002,7 @@ filestruct *backup_lines(filestruct *first_line, size_t par_len)
        top = openfile->current->prev;
     else
        top = openfile->current;
-    for (i = par_len; i > 0; i--) {
+    for (i = par_len; i > 0 && top != NULL; i--) {
        if (top->lineno == fl_lineno_save)
            first_line = top;
        if (top->lineno == edittop_lineno_save)