]> git.wh0rd.org Git - nano.git/commitdiff
in do_insertfile(), fix a problem where going into the help browser at
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 30 Mar 2005 23:52:02 +0000 (23:52 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 30 Mar 2005 23:52:02 +0000 (23:52 +0000)
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

ChangeLog
src/files.c

index 0e9d765bd1d062a2968c136f37292f234f81e0e9..0ad374e40458dfe826c131a11e67de300f393b6b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,10 @@ CVS code -
          builds with DEBUG defined again. (Mike Frysinger, found by
          Dmitri Vassilenko)
 - 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()
        - Rework handling of the results of getcwd() in order to avoid
          segfaults if they fail, and to remove uses of the nonportable
index 9da25f753295c805901ad814f089534c4fe18531..ae1e314ba104c5e4dd3f138093bd449eb9d7bf24 100644 (file)
@@ -557,8 +557,7 @@ void do_insertfile(
 #ifdef ENABLE_MULTIBUFFER
                && !ISSET(MULTIBUFFER)
 #endif
-               ))
-       {
+               )) {
            statusbar(_("Cancelled"));
            break;
        } else {
@@ -581,6 +580,7 @@ void do_insertfile(
 
                if (tmp == NULL)
                    continue;
+
                free(answer);
                answer = tmp;
 
@@ -597,6 +597,11 @@ void do_insertfile(
            }
 #endif
 
+           /* If we don't have a file yet, go back to the statusbar
+            * prompt. */
+           if (i != 0)
+               continue;
+
 #ifdef ENABLE_MULTIBUFFER
            if (!ISSET(MULTIBUFFER)) {
 #endif