From 03225330dc7f3be5b3384678f9dea13319598e84 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Tue, 28 Sep 2004 20:50:50 +0000 Subject: [PATCH] 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 --- ChangeLog | 1 + src/files.c | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8fb35276..7a2084c0 100644 --- 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 index e273fa1c..e356c4e7 100644 --- 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 */ -- 2.39.5