commit 29f446ec40c604655b5607d1f6e1224b66436d73
parent eb5d8383c83b8368a56c7335013638ff580d6c3f
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Sun, 7 Nov 2004 01:22:20 +0000
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
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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;