]> git.wh0rd.org Git - nano.git/commitdiff
simplify do_insertfile() by reusing variables where possible
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 28 Sep 2004 20:50:50 +0000 (20:50 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 28 Sep 2004 20:50:50 +0000 (20:50 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1951 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/files.c

index 8fb35276a0ec8e58f6a01db5b7e043d512b28bcf..7a2084c062570840f5fbfa5b92f581aa050a9d06 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -58,6 +58,7 @@ CVS code -
   do_insertfile()
        - Readd the NANO_SMALL #ifdef around the start_again: label to
          avoid a warning. (DLR)
+       - Simplify by reusing variables where possible. (DLR)
 - global.c:
   shortcut_init()
        - Remove redundant NANO_SMALL #ifdef. (DLR)
index e273fa1c6a748ccaab5e3ec6a7f257208ca41819..e356c4e795d609e5e08b710f32e3f62281b1092f 100644 (file)
@@ -520,13 +520,10 @@ void do_insertfile(void)
        }
 #endif /* ENABLE_MULTIBUFFER */
        if (i == NANO_EXTCMD_KEY) {
-           char *ans = mallocstrcpy(NULL, answer);
-           int ts = statusq(TRUE, extcmd_list, ans, NULL, 
+           int j = statusq(TRUE, extcmd_list, ans, NULL,
                _("Command to execute"));
 
-           free(ans);
-
-           if (ts == -1 || answer == NULL || answer[0] == '\0')
+           if (j == -1 || answer == NULL || answer[0] == '\0')
                goto start_again;
        }
 #endif /* !NANO_SMALL */