commit 0cefee1b35f96fb11f959a3f2ac1c295d18c81ee
parent e78908af8883306d639468256f6dea27d16f8303
Author: Drew DeVault <sir@cmpwn.com>
Date: Sat, 8 Jan 2022 14:09:14 +0100
path::join: minor improvements
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/path/join.ha b/path/join.ha
@@ -49,7 +49,5 @@ export fn add(buf: *buffer, items: str...) (str | errors::overflow) = {
// path would exceed [[PATH_MAX]], the program aborts.
export fn join(items: str...) str = {
static let buf = buffer { ... };
- reset(&buf);
- add(&buf, items...)!;
- return strings::dup(string(&buf));
+ return strings::dup(set(&buf, items...)!);
};