Commit 045d130c authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

really fix one of the last fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2545 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 9 additions and 9 deletions
+9 -9
...@@ -2441,7 +2441,7 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer, ...@@ -2441,7 +2441,7 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
{ {
int kbinput; int kbinput;
bool meta_key, func_key, s_or_t, ran_func, finished; bool meta_key, func_key, s_or_t, ran_func, finished;
size_t answer_len = strlen(curranswer); size_t curranswer_len = strlen(curranswer);
#ifndef DISABLE_TABCOMP #ifndef DISABLE_TABCOMP
bool tabbed = FALSE; bool tabbed = FALSE;
/* Whether we've pressed Tab more than once consecutively. */ /* Whether we've pressed Tab more than once consecutively. */
...@@ -2455,16 +2455,16 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer, ...@@ -2455,16 +2455,16 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
* any. */ * any. */
#endif #endif
answer = mallocstrcpy(answer, curranswer);
/* Only put statusbar_x at the end of the string if it's /* Only put statusbar_x at the end of the string if it's
* uninitialized, if it would be past the end of the string as it * uninitialized, if it would be past the end of curranswer, or if
* is, or if resetstatuspos is TRUE. Otherwise, leave it alone. * resetstatuspos is TRUE. Otherwise, leave it alone. This is so
* This is so the cursor position stays at the same place if a * the cursor position stays at the same place if a prompt-changing
* prompt-changing toggle is pressed. */ * toggle is pressed. */
if (statusbar_x == (size_t)-1 || statusbar_x > answer_len || if (statusbar_x == (size_t)-1 || statusbar_x > curranswer_len ||
resetstatuspos) resetstatuspos)
statusbar_x = answer_len; statusbar_x = curranswer_len;
answer = mallocstrcpy(answer, curranswer);
currshortcut = s; currshortcut = s;
......
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