commit be17e022d8d17fcbb9f2034e1c14a2f1392dde2b parent 90407118172676b71ea66f27029d5a87a877fbea Author: Lou Woell <lou.woell@posteo.de> Date: Fri, 10 Oct 2025 04:01:33 +0200 [locate] handle nested tagdirs Diffstat:
| M | cmd/harehelper/locate.ha | | | 15 | +++++++++++++-- |
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/cmd/harehelper/locate.ha b/cmd/harehelper/locate.ha @@ -55,11 +55,22 @@ fn locate_symbol ( } else if (len(id) <= 1) { let p = path::init(os::getcwd())!; - let dirname = path::peek(&p) as str; + let dirname = match (path::peek(&p)) { + case void => + yield "/"; + case let s: str => + yield s; + }; - if (strings::hasprefix(dirname, '+') || + for (strings::hasprefix(dirname, '+') || strings::hasprefix(dirname, '-')) { path::pop(&p); + dirname = match (path::peek(&p)) { + case void => + yield "/"; + case let s: str => + yield s; + }; }; yield &p; } else {