commit 03225330dc7f3be5b3384678f9dea13319598e84
parent 25884f3bdb631532c886d965da13493abc26a22f
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Tue, 28 Sep 2004 20:50:50 +0000
simplify do_insertfile() by reusing variables where possible
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1951 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git 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)
diff --git a/src/files.c b/src/files.c
@@ -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 */