mirror of https://github.com/fairyglade/ly.git
fix password not being cleared when blank_password is set
This commit is contained in:
parent
33934f3ab2
commit
825544f7e2
|
@ -160,7 +160,7 @@ void config_load(const char *cfg_path)
|
||||||
{"asterisk", &config.asterisk, config_handle_char},
|
{"asterisk", &config.asterisk, config_handle_char},
|
||||||
{"bg", &config.bg, config_handle_u8},
|
{"bg", &config.bg, config_handle_u8},
|
||||||
{"blank_box", &config.blank_box, config_handle_bool},
|
{"blank_box", &config.blank_box, config_handle_bool},
|
||||||
{"blank_password", &config.blank_box, config_handle_bool},
|
{"blank_password", &config.blank_password, config_handle_bool},
|
||||||
{"console_dev", &config.console_dev, config_handle_str},
|
{"console_dev", &config.console_dev, config_handle_str},
|
||||||
{"default_input", &config.default_input, config_handle_u8},
|
{"default_input", &config.default_input, config_handle_u8},
|
||||||
{"fg", &config.fg, config_handle_u8},
|
{"fg", &config.fg, config_handle_u8},
|
||||||
|
|
|
@ -258,3 +258,11 @@ void input_text_backspace(struct text* target)
|
||||||
input_text_delete(target);
|
input_text_delete(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void input_text_clear(struct text* target)
|
||||||
|
{
|
||||||
|
memset(target->text, 0, target->len + 1);
|
||||||
|
target->cur = target->text;
|
||||||
|
target->end = target->text;
|
||||||
|
target->visible_start = target->text;
|
||||||
|
}
|
||||||
|
|
|
@ -50,5 +50,6 @@ void input_text_left(struct text* target);
|
||||||
void input_text_write(struct text* target, char ascii);
|
void input_text_write(struct text* target, char ascii);
|
||||||
void input_text_delete(struct text* target);
|
void input_text_delete(struct text* target);
|
||||||
void input_text_backspace(struct text* target);
|
void input_text_backspace(struct text* target);
|
||||||
|
void input_text_clear(struct text* target);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -255,6 +255,11 @@ int main(int argc, char** argv)
|
||||||
buf.info_line = dgn_output_log();
|
buf.info_line = dgn_output_log();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.blank_password)
|
||||||
|
{
|
||||||
|
input_text_clear(&password);
|
||||||
|
}
|
||||||
|
|
||||||
dgn_reset();
|
dgn_reset();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue