]> Zhao Yanbai Git Server - minix.git/commitdiff
Make realpath deal with double slashes
authorErik van der Kouwe <erik@minix3.org>
Mon, 6 Sep 2010 07:45:32 +0000 (07:45 +0000)
committerErik van der Kouwe <erik@minix3.org>
Mon, 6 Sep 2010 07:45:32 +0000 (07:45 +0000)
lib/libc/other/realpath.c

index f331bd3d19fce1301e92bc04f46fb0bbe3886551..3a43445e7e0cbfa4d9aa48680cd2ab71b4d0051e 100644 (file)
@@ -170,8 +170,8 @@ static char *realpath_recurse(const char *file_name, char *resolved_name,
                        max_depth))
                        return NULL;
 
-               /* skip the slash */
-               if (*file_name == '/')
+               /* skip the slash(es) */
+               while (*file_name == '/')
                        file_name++;
        }