Consider OS/2-style path

OS/2 uses 'x:' as a drive prefix and '\' as a directory separator.
This commit is contained in:
KO Myung-Hun
2015-05-11 15:30:48 +09:00
parent a03cf65602
commit 759b6ec59f
7 changed files with 72 additions and 43 deletions

2
var.c
View File

@ -1281,7 +1281,7 @@ setspec(struct tbl *vp)
s = str_val(vp);
/* LINTED use of access */
if (s[0] == '/' && access(s, W_OK|X_OK) == 0 &&
if (IS_ABS_PATH(s) && access(s, W_OK|X_OK) == 0 &&
stat(s, &statb) == 0 && S_ISDIR(statb.st_mode))
strdupx(tmpdir, s, APERM);
}