1
0
Fork 0

fixpath: handle empty strings

This commit is contained in:
mfranz 2008-07-11 15:23:23 +00:00
parent 3be5c6956b
commit 86475efa5e

View file

@ -186,7 +186,7 @@ var match = func(str, patt) {
#
var fixpath = func(path) {
path = replace(path, "\\", "/");
var prefix = path[0] == `/` ? "/" : "";
var prefix = size(path) and path[0] == `/` ? "/" : "";
var stack = [];
foreach (var e; split("/", path)) {