mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
fix/expr: repair off-by-1 index operator error
This commit is contained in:
parent
be37e033be
commit
fe954e5825
1 changed files with 1 additions and 1 deletions
|
@ -478,7 +478,7 @@ fn prefix_operator_index(values: &[String]) -> String {
|
||||||
for (current_idx, ch_h) in haystack.chars().enumerate() {
|
for (current_idx, ch_h) in haystack.chars().enumerate() {
|
||||||
for ch_n in needles.chars() {
|
for ch_n in needles.chars() {
|
||||||
if ch_n == ch_h {
|
if ch_n == ch_h {
|
||||||
return current_idx.to_string();
|
return (current_idx + 1).to_string();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue