mirror of
https://github.com/sheumann/hush.git
synced 2024-09-12 00:55:11 +00:00
stty: fix mishandling of 'control' keywords (Ralf Friedl <Ralf.Friedl@online.de>)
This commit is contained in:
parent
ef67c5758a
commit
da42bd5bbe
@ -780,30 +780,14 @@ static const struct suffix_mult stty_suffixes[] = {
|
|||||||
|
|
||||||
static const struct mode_info *find_mode(const char *name)
|
static const struct mode_info *find_mode(const char *name)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = index_in_strings(mode_name, name);
|
||||||
const char *m = mode_name;
|
return i >= 0 ? &mode_info[i] : NULL;
|
||||||
|
|
||||||
while (*m) {
|
|
||||||
if (strcmp(name, m) == 0)
|
|
||||||
return &mode_info[i];
|
|
||||||
m += strlen(m) + 1;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct control_info *find_control(const char *name)
|
static const struct control_info *find_control(const char *name)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = index_in_strings(control_name, name);
|
||||||
const char *m = mode_name;
|
return i >= 0 ? &control_info[i] : NULL;
|
||||||
|
|
||||||
while (*m) {
|
|
||||||
if (strcmp(name, m) == 0)
|
|
||||||
return &control_info[i];
|
|
||||||
m += strlen(m) + 1;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
Loading…
Reference in New Issue
Block a user