Skip to content

Commit

Permalink
fix: handle empty base paths when joining
Browse files Browse the repository at this point in the history
  • Loading branch information
citycide authored and haltcase committed Jul 21, 2018
1 parent f9b4cdd commit 0cdb00f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/glob.nim
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ proc pathType (path: string, kind: var PathComponent): bool =
discard

proc maybeJoin (p1, p2: string): string =
if p2.isAbsolute: p2 else: p1 / p2
if p2 == "": p1
elif p2.isAbsolute: p2
else: p1 / p2

proc globToRegex* (pattern: string, isDos = isDosDefault): Regex =
## Converts a string glob pattern to a regex pattern.
Expand Down

0 comments on commit 0cdb00f

Please sign in to comment.