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.
This commit is contained in:
Taeer Bar-Yam 2021-08-31 08:21:42 -04:00
parent b2beb97f2a
commit 1ffb9f1970

View file

@ -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);
}