From 1ffb9f197075975a00cd95cddcb39a29b15aed86 Mon Sep 17 00:00:00 2001 From: Taeer Bar-Yam Date: Tue, 31 Aug 2021 08:21:42 -0400 Subject: fix parse of `/${foo}`. was `// + foo` I don't think this changes the way any program would behave, but it's a cleaner internal representation. --- src/libexpr/parser.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index 796e87cc1..e3749783a 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -459,7 +459,7 @@ path_start : PATH { Path path(absPath($1, data->basePath)); /* add back in the trailing '/' to the first segment */ - if ($1[strlen($1)-1] == '/') + if ($1[strlen($1)-1] == '/' && strlen($1) > 1) path += "/"; $$ = new ExprPath(path); } -- cgit v1.2.3