]> git.wh0rd.org Git - nano.git/commitdiff
simplify still more
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 8 Nov 2006 13:03:37 +0000 (13:03 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 8 Nov 2006 13:03:37 +0000 (13:03 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3947 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

src/files.c

index 9102ea7b849ff95fe62f72b06a0796754001bffe..e20e7a16dd21a444ef31ac483a7b2fda2c31aab5 100644 (file)
@@ -1874,11 +1874,13 @@ int do_writeout(bool exiting)
                bool different_name = (strcmp(full_answer,
                        full_filename) != 0);
                struct stat st;
-               bool name_exists = (stat(full_answer, &st) != -1);
+               bool name_exists;
 
                free(full_filename);
                free(full_answer);
 
+               name_exists = (stat(answer, &st) != -1);
+
                if (different_name) {
                    if (name_exists) {
                        /* If we're using restricted mode, we aren't