aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaeer Bar-Yam <taeer@bar-yam.me>2021-08-31 08:21:42 -0400
committerTaeer Bar-Yam <taeer@bar-yam.me>2021-08-31 15:55:55 -0400
commit1ffb9f197075975a00cd95cddcb39a29b15aed86 (patch)
tree2bf6d474bace6a8a76fc0c52b66402ca956b64f5
parentb2beb97f2ae5fbade5e5ac0763ffbefdc4057ee8 (diff)
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.
-rw-r--r--src/libexpr/parser.y2
1 files changed, 1 insertions, 1 deletions
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);
}