From: John Hodge Date: Mon, 9 Jul 2012 07:09:57 +0000 (+0800) Subject: Kernel/VFS - Fixed missuse of strcmp that caused userland compilations to break X-Git-Tag: rel0.15~611^2~41^2~26 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=3d16754198031c1fe2e5b012f7313aff4261ec2a;hp=aa3975dc61be78c0e6860cafad7278017fd456d5;p=tpg%2Facess2.git Kernel/VFS - Fixed missuse of strcmp that caused userland compilations to break --- diff --git a/KernelLand/Kernel/vfs/open.c b/KernelLand/Kernel/vfs/open.c index cfb296b6..2865f781 100644 --- a/KernelLand/Kernel/vfs/open.c +++ b/KernelLand/Kernel/vfs/open.c @@ -222,11 +222,11 @@ restart_parse: // Length Check - If the length is smaller than the longest match sofar if(mnt->MountPointLen < longestMount->MountPointLen) continue; // String Compare - cmp = strcmp(Path, mnt->MountPoint); + cmp = strncmp(Path, mnt->MountPoint, mnt->MountPointLen); #if OPEN_MOUNT_ROOT // Fast Break - Request Mount Root - if(cmp == 0) { + if(Path[mnt->MountPointLen] == '\0') { if(TruePath) { *TruePath = malloc( mnt->MountPointLen+1 ); strcpy(*TruePath, mnt->MountPoint); @@ -238,7 +238,7 @@ restart_parse: } #endif // Not a match, continue - if(cmp != '/') continue; + if(cmp != 0) continue; longestMount = mnt; }