Index: uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mkdir/mkdir.c	(revision eb9618c17fac7b6666cab01b982317bc979e9109)
+++ uspace/app/bdsh/cmds/modules/mkdir/mkdir.c	(revision ab5a45e04b0ccbe437b7431cfdf1b1d61d92fb73)
@@ -148,6 +148,7 @@
 
 	while (dirs[i] != NULL) {
-		/* Rewind to start of relative path */
-		while (!strcmp(dirs[i], "..")) {
+		/* Sometimes make or scripts conjoin odd paths. Account for something
+		 * like this: ../../foo/bar/../foo/foofoo/./bar */
+		if (!strcmp(dirs[i], "..") || !strcmp(dirs[i], ".")) {
 			if (0 != (chdir(dirs[i]))) {
 				cli_error(CL_EFAIL, "%s: impossible path: %s",
@@ -156,11 +157,4 @@
 				goto finit;
 			}
-			i++;
-		}
-		getcwd(wdp, PATH_MAX);
-		/* Sometimes make or scripts conjoin odd paths. Account for something
-		 * like this: ../../foo/bar/../foo/foofoo/./bar */
-		if (!strcmp(dirs[i], "..") || !strcmp(dirs[i], ".")) {
-			chdir(dirs[i]);
 			getcwd(wdp, PATH_MAX);
 		} else {
