Fixed offset issue with slashNum
authorJohn Hodge <[email protected]>
Sun, 27 Sep 2009 10:23:20 +0000 (18:23 +0800)
committerJohn Hodge <[email protected]>
Sun, 27 Sep 2009 10:23:20 +0000 (18:23 +0800)
Kernel/vfs/open.c

index 2eccac2..9069a73 100644 (file)
@@ -89,9 +89,9 @@ char *VFS_GetAbsPath(char *Path)
                        if(strncmp(&ret[read], "..", pos-read) == 0)
                        {
                                // If there is no higher, silently ignore
-                               if(!slashNum)   continue;
+                               if(slashNum < 2)        continue;
                                // Reverse write pointer
-                               write = slashOffsets[ --slashNum ];
+                               write = slashOffsets[ --slashNum - 1 ];
                                continue;
                        }
                }

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