Use strncmp()
Change-Id: I593ce24ce83cd3034d23297adc3de5f6de18f3a9
This commit is contained in:
@@ -272,8 +272,7 @@ int open_c(const char *cpPath, int oflag, int mode)
|
|||||||
// scoped bookmark for it so that we can access the file in
|
// scoped bookmark for it so that we can access the file in
|
||||||
// the future, too. (For the "Recent Files" functionality.)
|
// the future, too. (For the "Recent Files" functionality.)
|
||||||
const char *sandbox = [NSHomeDirectory() UTF8String];
|
const char *sandbox = [NSHomeDirectory() UTF8String];
|
||||||
if (!(strlen(cpPath) > strlen(sandbox) &&
|
if (!(strncmp(sandbox, cpPath, strlen(sandbox)) == 0 &&
|
||||||
memcmp(sandbox, cpPath, strlen(sandbox)) == 0 &&
|
|
||||||
cpPath[strlen(sandbox)] == '/'))
|
cpPath[strlen(sandbox)] == '/'))
|
||||||
{
|
{
|
||||||
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:cpPath]];
|
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:cpPath]];
|
||||||
|
Reference in New Issue
Block a user