diff options
| Commit | 2e39a9a44f11e6989565fc0d832f67c335c67873 (patch) | |
|---|---|---|
| Author | 2023-04-29 11:40:10 +0300 | |
| Committer | 2023-04-29 11:40:10 +0300 | |
| Files | 56219a18e5b450a7b6de1288ebad7f26a9746254 /awk-edits/#strings.awk | |
| syndamia.com-2e39a9a44f11e6989565fc0d832f67c335c67873.tar syndamia.com-2e39a9a44f11e6989565fc0d832f67c335c67873.tar.gz syndamia.com-2e39a9a44f11e6989565fc0d832f67c335c67873.zip | ||
| Parent | 256745e04194ec60d3d3069909afdef85e060d35 (diff) | |
[#strings/glsub] Fixed bad behaviour when regexp matches next to each other (and lbregexp regexp largexep doesn't match longer)
1 files changed, 2 insertions, 1 deletions
| -rw-r--r-- | awk-edits/#strings.awk | 3 |
diff --git a/awk-edits/#strings.awk b/awk-edits/#strings.awk index 6972105..074e42a 100644 --- a/awk-edits/#strings.awk +++ b/awk-edits/#strings.awk @@ -57,7 +57,8 @@ function glsub(lbregexp, regexp, laregexp, replacement, target) { target = substr(target, length(surrounds[1]) + 1); for (i = 2; i <= surlen; i++) { if (surrounds[i] == "") { - si = length(target) + 1; + match(target, lbregexp regexp laregxep); + si = RLENGTH + 1; } else { si = index(target, surrounds[i]); |