Kernel - Added ctype.h header
[tpg/acess2.git] / KernelLand / Kernel / vfs / open.c
index cfb296b..d55b754 100644 (file)
@@ -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;
        }
        
@@ -485,7 +485,10 @@ int VFS_OpenEx(const char *Path, Uint Flags, Uint Mode)
        {
                // TODO: Translate `Mode` into ACL and node flags
                // Get parent, create node
-               VFS_MkNod(absPath, 0);
+               if( VFS_MkNod(absPath, 0) ) {
+                       free(absPath);
+                       return -1;
+               }
                node = VFS_ParsePath(absPath, NULL, &mnt);
        }
        

UCC git Repository :: git.ucc.asn.au