=== modified file 'uspace/app/bdsh/cmds/modules/mkdir/mkdir.c'
--- uspace/app/bdsh/cmds/modules/mkdir/mkdir.c	2011-06-17 16:00:53 +0000
+++ uspace/app/bdsh/cmds/modules/mkdir/mkdir.c	2012-04-13 22:52:38 +0000
@@ -80,6 +80,39 @@
 	return;
 }
 
+/* Get parents from path */
+static int 
+get_parents_directories(char *path, char **dirs)
+{
+	char *tok = NULL;
+	int word_index = 0;
+	
+	if(path==NULL || dirs==NULL)
+		return -1;
+	
+	while(*path != 0 && word_index < 255)
+	{
+		while(*path != 0 && *path == '/')
+			path++;
+
+		/* Beggining of parent */
+		tok = path;	
+						
+		while(*path != 0 && *path != '/')
+			path++;
+
+		dirs[word_index++] = tok;
+		
+		/* End of parent */
+		if(*path != 0)
+			*path++ = 0;
+
+	}
+	
+	dirs[word_index] = NULL;
+	return 1;
+}
+
 /* This is kind of clunky, but effective for now */
 static unsigned int
 create_directory(const char *path, unsigned int p)
@@ -126,10 +159,8 @@
 		absolute = 1;
 
 	/* TODO: Canonify the path prior to tokenizing it, see below */
-	dirs[i] = strtok(tmp, "/");
-	while (dirs[i] && i < 255)
-		dirs[++i] = strtok(NULL, "/");
-
+	get_parents_directories(tmp, dirs);
+	
 	if (NULL == dirs[0])
 		return 1;
 

