acme: fix mtpt crash (Tim Wiess)
This commit is contained in:
parent
a2660887c0
commit
5d32c407ba
@ -1068,6 +1068,9 @@ ismtpt(char *file)
|
|||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
if(mtpt == nil)
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* This is not foolproof, but it will stop a lot of them. */
|
/* This is not foolproof, but it will stop a lot of them. */
|
||||||
n = strlen(mtpt);
|
n = strlen(mtpt);
|
||||||
return strncmp(file, mtpt, n) == 0 && ((n > 0 && mtpt[n-1] == '/') || file[n] == '/' || file[n] == 0);
|
return strncmp(file, mtpt, n) == 0 && ((n > 0 && mtpt[n-1] == '/') || file[n] == '/' || file[n] == 0);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user