Commit c11c6884 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: fix compilation with --enable-tiny again

parent 514cd9a0
Showing with 19 additions and 13 deletions
+19 -13
...@@ -652,7 +652,7 @@ int do_prompt(bool allow_tabs, ...@@ -652,7 +652,7 @@ int do_prompt(bool allow_tabs,
void (*refresh_func)(void), const char *msg, ...) void (*refresh_func)(void), const char *msg, ...)
{ {
va_list ap; va_list ap;
int retval = KEY_WINCH; int retval;
functionptrtype func = NULL; functionptrtype func = NULL;
#ifndef DISABLE_TABCOMP #ifndef DISABLE_TABCOMP
bool listed = FALSE; bool listed = FALSE;
...@@ -664,15 +664,17 @@ int do_prompt(bool allow_tabs, ...@@ -664,15 +664,17 @@ int do_prompt(bool allow_tabs,
answer = mallocstrcpy(answer, curranswer); answer = mallocstrcpy(answer, curranswer);
while (retval == KEY_WINCH) { #ifndef NANO_TINY
prompt = charalloc((COLS * mb_cur_max()) + 1); redo_theprompt:
va_start(ap, msg); #endif
vsnprintf(prompt, COLS * mb_cur_max(), msg, ap); prompt = charalloc((COLS * mb_cur_max()) + 1);
va_end(ap); va_start(ap, msg);
/* Reserve five columns for colon plus angles plus answer, ":<aa>". */ vsnprintf(prompt, COLS * mb_cur_max(), msg, ap);
null_at(&prompt, actual_x(prompt, (COLS < 5) ? 0 : COLS - 5)); va_end(ap);
/* Reserve five columns for colon plus angles plus answer, ":<aa>". */
func = acquire_an_answer(&retval, allow_tabs, null_at(&prompt, actual_x(prompt, (COLS < 5) ? 0 : COLS - 5));
func = acquire_an_answer(&retval, allow_tabs,
#ifndef DISABLE_TABCOMP #ifndef DISABLE_TABCOMP
allow_files, &listed, allow_files, &listed,
#endif #endif
...@@ -681,9 +683,13 @@ int do_prompt(bool allow_tabs, ...@@ -681,9 +683,13 @@ int do_prompt(bool allow_tabs,
#endif #endif
refresh_func); refresh_func);
free(prompt); free(prompt);
prompt = NULL; prompt = NULL;
}
#ifndef NANO_TINY
if (retval == KEY_WINCH)
goto redo_theprompt;
#endif
/* If we're done with this prompt, restore the x position to what /* If we're done with this prompt, restore the x position to what
* it was at a possible previous prompt. */ * it was at a possible previous prompt. */
......
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