Skip to content

Commit 7de0bd8

Browse files
authored
Merge pull request #182 from asakovets/fix-expanduser
fspath: fix ExpandUser
2 parents 93cc278 + 954c54f commit 7de0bd8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

blink/fspath.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ char *JoinPath(const char *x, const char *y) {
4444

4545
char *ExpandUser(const char *path) {
4646
const char *home;
47-
if (*path == '~' && (home = getenv("HOME"))) {
48-
return JoinPath(home, path);
47+
if (path[0] == '~' && path[1] == '/' && (home = getenv("HOME"))) {
48+
return JoinPath(home, &path[2]);
4949
} else {
5050
return strdup(path);
5151
}

0 commit comments

Comments
 (0)