Don't segfault if xabspath() returns null (spotted by Taolaw).
This commit is contained in:
parent
20c123b95d
commit
6d4847934f
@ -83,7 +83,7 @@ char *mime(char *file)
|
||||
static int isunder(char *file, char *dir)
|
||||
{
|
||||
char *s1 = xabspath(dir, ABS_FILE), *s2 = xabspath(file, 0), *ss = s2;
|
||||
int rc = strstart(&ss, s2) && (!*ss || *ss=='/' || ss[-1]=='/');
|
||||
int rc = s1 && s2 && strstart(&ss, s1) && (!*ss || *ss=='/' || ss[-1]=='/');
|
||||
|
||||
free(s2);
|
||||
free(s1);
|
||||
|
Loading…
Reference in New Issue
Block a user