Skip to content

Commit 886da1d

Browse files
committed
Additional tweak for tilde expansion in paths
1 parent cf2cc0e commit 886da1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/PerfectLib/File.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class File {
9999
}
100100

101101
static func resolveTilde(inPath: String) -> String {
102-
if inPath[inPath.startIndex] == "~" {
102+
if !inPath.isEmpty && inPath[inPath.startIndex] == "~" {
103103
var wexp = wordexp_t()
104104
wordexp(inPath, &wexp, 0)
105105
if let resolved = wexp.we_wordv[0], pth = String(validatingUTF8: resolved) {

0 commit comments

Comments
 (0)