Fix rtrimstr("") always output "" (#3415)

Example
---
**Before this fix**:

```sh
$ jq -n '"foo"|rtrimstr("")'
""
```

**After this fix**:

```sh
$ jq -n '"foo"|rtrimstr("")'
"foo"
```
This commit is contained in:
A4-Tacks authored and GitHub committed 2025-09-29 17:15:43 +02:00
1 parent c8017bf079
commit 169457328d
2 files changed
+13 -1

No files matched your search

+12
View File
@@ -1512,6 +1512,18 @@ split("")
["fo", "foo", "barfoo", "foobarfoo", "foob"]
["fo","","bar","bar","b"]
[.[]|ltrimstr("")]
["a", "xx", ""]
["a", "xx", ""]
[.[]|rtrimstr("")]
["a", "xx", ""]
["a", "xx", ""]
[.[]|trimstr("")]
["a", "xx", ""]
["a", "xx", ""]
[(index(","), rindex(",")), indices(",")]
"a,bc,def,ghij,klmno"
[1,13,[1,4,8,13]]