Towards working mkdir.

This commit is contained in:
Bahadir Balban
2008-04-14 14:38:04 +01:00
parent d6d97876bb
commit 287b7705da
9 changed files with 83 additions and 17 deletions

View File

@@ -31,6 +31,10 @@ char *splitpath(char **str, char sep)
char *cursor = *str;
char *end;
/* Root is the special case, return it as is. */
if (strcmp(*str, "/"))
return *str;
/* Move forward until no seperator */
while (*cursor == sep) {
*cursor = '\0';
@@ -67,6 +71,9 @@ char *splitpath_end(char **path, char sep)
/* Reverse the rest back to original. */
strreverse(*path);
/* Reverse component back to original */
strreverse(component);
return component;
}