]> git.wh0rd.org Git - nano.git/commitdiff
don't let remove_magicline() remove the magicline if it's the only line
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Sun, 7 Nov 2004 01:22:20 +0000 (01:22 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Sun, 7 Nov 2004 01:22:20 +0000 (01:22 +0000)
in the file

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

src/utils.c

index 71de9b1d5c5458c578fc916fa4b5e5a43e17f833..2501568d63f99b94c36f0da9c37e12bc42454d42 100644 (file)
@@ -444,7 +444,7 @@ void new_magicline(void)
 /* Remove the magicline from filebot, if there is one. */
 void remove_magicline(void)
 {
-    if (filebot->data[0] == '\0') {
+    if (filebot->data[0] == '\0' && filebot->prev != NULL) {
        filebot = filebot->prev;
        free_filestruct(filebot->next);
        filebot->next = NULL;