mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
(edit_execute_cmd): refactor loop.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
442af62c07
commit
c3bc294bb3
@ -3381,7 +3381,7 @@ edit_execute_cmd (WEdit * edit, long command, int char_for_insertion)
|
||||
&& !mc_global.utf8_display)
|
||||
{
|
||||
unsigned char str[UTF8_CHAR_LEN + 1];
|
||||
size_t i = 0;
|
||||
size_t i;
|
||||
int res;
|
||||
|
||||
res = g_unichar_to_utf8 (char_for_insertion, (char *) str);
|
||||
@ -3394,11 +3394,10 @@ edit_execute_cmd (WEdit * edit, long command, int char_for_insertion)
|
||||
{
|
||||
str[res] = '\0';
|
||||
}
|
||||
while (i <= UTF8_CHAR_LEN && str[i] != '\0')
|
||||
for (i = 0; i <= UTF8_CHAR_LEN && str[i] != '\0'; i++)
|
||||
{
|
||||
char_for_insertion = str[i];
|
||||
edit_insert (edit, char_for_insertion);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user