From: David Lawrence Ramsey Date: Sun, 7 Nov 2004 01:22:20 +0000 (+0000) Subject: don't let remove_magicline() remove the magicline if it's the only line X-Git-Tag: v1.3.5~43 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=29f446ec40c604655b5607d1f6e1224b66436d73;p=nano.git don't let remove_magicline() remove the magicline if it's the only line in the file git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2077 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/utils.c b/src/utils.c index 71de9b1d..2501568d 100644 --- a/src/utils.c +++ b/src/utils.c @@ -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;