]> granicus.if.org Git - mutt/commitdiff
Fix "tab-tab" at the change-folder prompt.
authorThomas Roessler <roessler@does-not-exist.org>
Thu, 14 Dec 2000 13:26:13 +0000 (13:26 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Thu, 14 Dec 2000 13:26:13 +0000 (13:26 +0000)
enter.c

diff --git a/enter.c b/enter.c
index d69971a2c229791c147552469c7d36b575484d68..2beeeb0c68ce0e1ed0d7e2a331f161c2f7f42b47 100644 (file)
--- a/enter.c
+++ b/enter.c
@@ -457,7 +457,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int y, int x,
          {
            my_wcstombs (buf, buflen, state->wbuf, state->curpos);
            i = strlen (buf);
-           if (buf[i - 1] == '=' &&
+           if (i && buf[i - 1] == '=' &&
                mutt_var_value_complete (buf, buflen, i))
              tabs = 0;
            else if (!mutt_command_complete (buf, buflen, i, tabs))
@@ -469,8 +469,8 @@ int _mutt_enter_string (char *buf, size_t buflen, int y, int x,
            my_wcstombs (buf, buflen, state->wbuf, state->curpos);
 
            /* see if the path has changed from the last time */
-           if (tempbuf && templen == state->lastchar &&
-               !memcmp (tempbuf, state->wbuf, state->lastchar * sizeof (wchar_t)))
+           if (!tempbuf || (templen == state->lastchar &&
+               !memcmp (tempbuf, state->wbuf, state->lastchar * sizeof (wchar_t))))
            {
              _mutt_select_file (buf, buflen, 0, multiple, files, numfiles);
              set_option (OPTNEEDREDRAW);