Index: uspace/lib/libfs/libfs.c
===================================================================
--- uspace/lib/libfs/libfs.c	(revision 9ad75d53c71123a0763106d4d037755479b19fb0)
+++ uspace/lib/libfs/libfs.c	(revision c9f6e49f0fb66a74ff19dac4951b9b121322ca4f)
@@ -143,4 +143,6 @@
 	int lflag = IPC_GET_ARG4(*request);
 	fs_index_t index = IPC_GET_ARG5(*request); /* when L_LINK specified */
+	char component[NAME_MAX + 1];
+	int len;
 
 	if (last < next)
@@ -153,10 +155,9 @@
 		next++;		/* eat slash */
 	
-	char component[NAME_MAX + 1];
-	int len = 0;
 	while (ops->has_children(cur) && next <= last) {
 		void *tmp;
 
 		/* collect the component */
+		len = 0;
 		while ((ops->plb_get_char(next) != '/') && (next <= last)) {
 			if (len + 1 == NAME_MAX) {
@@ -172,5 +173,4 @@
 		component[len] = '\0';
 		next++;		/* eat slash */
-		len = 0;
 
 		/* match the component */
@@ -237,4 +237,5 @@
 
 			/* collect next component */
+			len = 0;
 			while (next <= last) {
 				if (ops->plb_get_char(next) == '/') {
@@ -253,5 +254,4 @@
 			assert(len);
 			component[len] = '\0';
-			len = 0;
 				
 			void *nodep;
