Commit 88ad64d5 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

in do_insertfile(), fix a problem where going into the help browser at

the "Insert File" prompt would always result in the current answer's
being used as the filename afterward


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2443 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Showing with 11 additions and 2 deletions
+11 -2
...@@ -15,6 +15,10 @@ CVS code - ...@@ -15,6 +15,10 @@ CVS code -
builds with DEBUG defined again. (Mike Frysinger, found by builds with DEBUG defined again. (Mike Frysinger, found by
Dmitri Vassilenko) Dmitri Vassilenko)
- files.c: - files.c:
do_insertfile()
- Fix problem where going into the help browser at the "Insert
File" prompt would always result in the current answer's being
used as the filename afterward. (DLR)
get_full_path() get_full_path()
- Rework handling of the results of getcwd() in order to avoid - Rework handling of the results of getcwd() in order to avoid
segfaults if they fail, and to remove uses of the nonportable segfaults if they fail, and to remove uses of the nonportable
......
...@@ -557,8 +557,7 @@ void do_insertfile( ...@@ -557,8 +557,7 @@ void do_insertfile(
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
&& !ISSET(MULTIBUFFER) && !ISSET(MULTIBUFFER)
#endif #endif
)) )) {
{
statusbar(_("Cancelled")); statusbar(_("Cancelled"));
break; break;
} else { } else {
...@@ -581,6 +580,7 @@ void do_insertfile( ...@@ -581,6 +580,7 @@ void do_insertfile(
if (tmp == NULL) if (tmp == NULL)
continue; continue;
free(answer); free(answer);
answer = tmp; answer = tmp;
...@@ -597,6 +597,11 @@ void do_insertfile( ...@@ -597,6 +597,11 @@ void do_insertfile(
} }
#endif #endif
/* If we don't have a file yet, go back to the statusbar
* prompt. */
if (i != 0)
continue;
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
if (!ISSET(MULTIBUFFER)) { if (!ISSET(MULTIBUFFER)) {
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment