in get_prompt_string(), use a do/while loop instead of a while loop, for
consistency git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3287 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
c0dcdf43c6
Коммит
591c409f3f
@ -35,6 +35,10 @@ CVS code -
|
|||||||
- files.c:
|
- files.c:
|
||||||
is_dir()
|
is_dir()
|
||||||
- Rename parameter ret to retval, for consistency. (DLR)
|
- Rename parameter ret to retval, for consistency. (DLR)
|
||||||
|
- prompt.c:
|
||||||
|
get_prompt_string()
|
||||||
|
- Use a do/while loop instead of a while loop, for consistency.
|
||||||
|
(DLR)
|
||||||
- utils.c:
|
- utils.c:
|
||||||
ngetdelim()
|
ngetdelim()
|
||||||
- Do sanity checks manually again instead of in an assert, and
|
- Do sanity checks manually again instead of in an assert, and
|
||||||
|
11
src/prompt.c
11
src/prompt.c
@ -911,7 +911,7 @@ int get_prompt_string(bool allow_tabs,
|
|||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int kbinput;
|
int kbinput = ERR;
|
||||||
bool meta_key, func_key, s_or_t, ran_func, finished;
|
bool meta_key, func_key, s_or_t, ran_func, finished;
|
||||||
size_t curranswer_len;
|
size_t curranswer_len;
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifndef DISABLE_TABCOMP
|
||||||
@ -961,10 +961,7 @@ int get_prompt_string(bool allow_tabs,
|
|||||||
* to files not specified on the command line. In this case,
|
* to files not specified on the command line. In this case,
|
||||||
* disable all keys that would change the text if the filename isn't
|
* disable all keys that would change the text if the filename isn't
|
||||||
* blank and we're at the "Write File" prompt. */
|
* blank and we're at the "Write File" prompt. */
|
||||||
while ((kbinput = do_statusbar_input(&meta_key, &func_key,
|
do {
|
||||||
&s_or_t, &ran_func, &finished, TRUE)) != NANO_CANCEL_KEY &&
|
|
||||||
kbinput != NANO_ENTER_KEY) {
|
|
||||||
|
|
||||||
assert(statusbar_x <= strlen(answer));
|
assert(statusbar_x <= strlen(answer));
|
||||||
|
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifndef DISABLE_TABCOMP
|
||||||
@ -1063,7 +1060,9 @@ int get_prompt_string(bool allow_tabs,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
reset_statusbar_cursor();
|
reset_statusbar_cursor();
|
||||||
}
|
} while ((kbinput = do_statusbar_input(&meta_key, &func_key,
|
||||||
|
&s_or_t, &ran_func, &finished, TRUE)) != NANO_CANCEL_KEY &&
|
||||||
|
kbinput != NANO_ENTER_KEY);
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* Set the current position in the history list to the bottom and
|
/* Set the current position in the history list to the bottom and
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user