diff options
author | Taeer Bar-Yam <taeer@bar-yam.me> | 2021-08-31 08:21:42 -0400 |
---|---|---|
committer | Taeer Bar-Yam <taeer@bar-yam.me> | 2021-08-31 15:55:55 -0400 |
commit | 1ffb9f197075975a00cd95cddcb39a29b15aed86 (patch) | |
tree | 2bf6d474bace6a8a76fc0c52b66402ca956b64f5 | |
parent | b2beb97f2ae5fbade5e5ac0763ffbefdc4057ee8 (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.y | 2 |
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); } |