input: let the handler of string binds return a byte whenever possible
The function get_code_from_plantation() should return ERR only when the string bind is fully exhausted. In the normal case, where some bytes are still available, it should return the first of these bytes, so that the {verbatim} function will work too. This fixes https://savannah.gnu.org/bugs/?63702. Bug existed since version 7.0, commit 958ec294, since command cartouches were introduced.
Этот коммит содержится в:
родитель
b896670e85
Коммит
51c9f7270c
@ -383,6 +383,7 @@ int get_code_from_plantation(void)
|
||||
return PLANTED_COMMAND;
|
||||
} else {
|
||||
char *opening = strchr(plants_pointer, '{');
|
||||
char firstbyte = *plants_pointer;
|
||||
int length;
|
||||
|
||||
if (opening) {
|
||||
@ -391,12 +392,12 @@ int get_code_from_plantation(void)
|
||||
} else
|
||||
length = strlen(plants_pointer);
|
||||
|
||||
for (int index = length - 1; index >= 0; index--)
|
||||
for (int index = length - 1; index > 0; index--)
|
||||
put_back((unsigned char)plants_pointer[index]);
|
||||
|
||||
plants_pointer += length;
|
||||
|
||||
return ERR;
|
||||
return (firstbyte) ? firstbyte : ERR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user