stris(1): fix bug only checking the first rune of strings

This commit is contained in:
dtb 2024-05-03 21:36:23 -06:00
parent 3910c341bd
commit 7c9f640ee1
Signed by: trinity
GPG Key ID: 31FF85CCB6DC7641

View File

@ -72,7 +72,7 @@ fn main() -> ExitCode {
drop(argv); drop(argv);
if reqs.inuse { if reqs.inuse {
'args: for arg in args().skip(opts.index()) { for arg in args().skip(opts.index()) {
for c in arg.chars() { for c in arg.chars() {
if (reqs.ascii && c.is_ascii()) if (reqs.ascii && c.is_ascii())
|| (reqs.blank && c.is_whitespace()) || (reqs.blank && c.is_whitespace())
@ -81,7 +81,7 @@ fn main() -> ExitCode {
|| (reqs.lower && c.is_lowercase()) || (reqs.lower && c.is_lowercase())
|| (reqs.upper && c.is_uppercase()) || (reqs.upper && c.is_uppercase())
|| reqs.extra.contains(c) { || reqs.extra.contains(c) {
continue 'args; continue;
} else { } else {
return ExitCode::FAILURE; return ExitCode::FAILURE;
} }