about summary refs log tree commit diff stats
path: root/src/utils/twtstr.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-12-01 21:24:34 +0100
committerbptato <nincsnevem662@gmail.com>2023-12-10 15:08:38 +0100
commite5a0fd6af4296f76987530a9566eb019307fa8bf (patch)
tree7002cc8d9772cd2bc4e78d7785a524eae791f5aa /src/utils/twtstr.nim
parent3cadec11d0d8758c1a396ce77a61d5adab5bc6c1 (diff)
downloadchawan-e5a0fd6af4296f76987530a9566eb019307fa8bf.tar.gz
config: better path handling; fix array parsing bug
* Paths are now parsed through an unified code path with some useful
  additions like environment variable substitution.
* Fix a bug in parseConfigValue where strings would be appended to
  existing arrays (and not override them).
* Fix beforeLast calling afterLast for some reason.
* Add a default CGI directory.
Diffstat (limited to 'src/utils/twtstr.nim')
-rw-r--r--src/utils/twtstr.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim
index 8372e588..9e40b920 100644
--- a/src/utils/twtstr.nim
+++ b/src/utils/twtstr.nim
@@ -237,7 +237,7 @@ func beforeLast*(s: string, c: set[char], n = 1): string =
         return s.substr(0, i)
   return s
 
-func beforeLast*(s: string, c: char, n = 1): string = s.afterLast({c}, n)
+func beforeLast*(s: string, c: char, n = 1): string = s.beforeLast({c}, n)
 
 proc c_sprintf(buf, fm: cstring): cint {.header: "<stdio.h>", importc: "sprintf", varargs}