]> git.wh0rd.org Git - nano.git/commitdiff
do_writeout() - Check for open_files == NULL before using it (Ryan Krebs)
authorChris Allegretta <chrisa@asty.org>
Tue, 17 Jul 2001 10:42:50 +0000 (10:42 +0000)
committerChris Allegretta <chrisa@asty.org>
Tue, 17 Jul 2001 10:42:50 +0000 (10:42 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@734 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
files.c

index 9f6958f66bd17d4cdae2866da695cf935279ee84..f67198a639b411a1be927d17e8e45a2c9399c01e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@ CVS code -
 - nano.c:
   main()
        - Change the getop option to 'F' (David Lawrence Ramsey)
+- files.c:
+  do_writeout()
+       - Check for open_files == NULL before using it (Ryan Krebs)
 - global.c:
   shortcut_init()
        - Rewrote the whereis and replace lists to put CANCEL at the end
diff --git a/files.c b/files.c
index 3b804a57d98683d22be24007f04efc87284f6816..f35e69ae176aeeb11108d13f6e2a76053266d8b5 100644 (file)
--- a/files.c
+++ b/files.c
@@ -1168,7 +1168,7 @@ int do_writeout(char *path, int exiting, int append)
                   update the filename and full path stored in the
                   current entry, and then update the current entry,
                   checking for duplicate entries */
-               if (strcmp(open_files->data, filename)) {
+               if (open_files != NULL && strcmp(open_files->data, filename)) {
                    open_file_change_name();
                    add_open_file(1, 1);
                }