Index: kernel/generic/src/console/kconsole.c
===================================================================
--- kernel/generic/src/console/kconsole.c	(revision b2e121ad525328882607c97cdba1a9ded6137d13)
+++ kernel/generic/src/console/kconsole.c	(revision f1380b76772fb5d1aa03637b5e57bd9b929fea61)
@@ -98,5 +98,5 @@
 {
 	unsigned int i;
-	
+
 	cmd_init();
 	for (i = 0; i < KCONSOLE_HISTORY; i++)
@@ -114,5 +114,5 @@
 {
 	spinlock_lock(&cmd_lock);
-	
+
 	/*
 	 * Make sure the command is not already listed.
@@ -124,5 +124,5 @@
 			return false;
 		}
-		
+
 		/* Avoid deadlock. */
 		if (hlp < cmd) {
@@ -133,5 +133,5 @@
 			spinlock_lock(&hlp->lock);
 		}
-		
+
 		if (str_cmp(hlp->name, cmd->name) == 0) {
 			/* The command is already there. */
@@ -141,14 +141,14 @@
 			return false;
 		}
-		
+
 		spinlock_unlock(&hlp->lock);
 		spinlock_unlock(&cmd->lock);
 	}
-	
+
 	/*
 	 * Now the command can be added.
 	 */
 	list_append(&cmd->link, &cmd_list);
-	
+
 	spinlock_unlock(&cmd_lock);
 	return true;
@@ -168,27 +168,27 @@
 	link_t **startpos = (link_t**) ctx;
 	size_t namelen = str_length(name);
-	
+
 	spinlock_lock(&cmd_lock);
-	
+
 	if (*startpos == NULL)
 		*startpos = cmd_list.head.next;
-	
+
 	for (; *startpos != &cmd_list.head; *startpos = (*startpos)->next) {
 		cmd_info_t *hlp = list_get_instance(*startpos, cmd_info_t, link);
-		
+
 		const char *curname = hlp->name;
 		if (str_length(curname) < namelen)
 			continue;
-		
+
 		if (str_lcmp(curname, name, namelen) == 0) {
 			*startpos = (*startpos)->next;
 			if (h)
 				*h = hlp->description;
-			
+
 			spinlock_unlock(&cmd_lock);
 			return (curname + str_lsize(curname, namelen));
 		}
 	}
-	
+
 	spinlock_unlock(&cmd_lock);
 	return NULL;
@@ -207,7 +207,7 @@
 {
 	const char *name = input;
-	
+
 	size_t found = 0;
-	
+
 	/*
 	 * Maximum Match Length: Length of longest matching common
@@ -223,14 +223,14 @@
 	size_t total_hints_shown = 0;
 	bool continue_showing_hints = true;
-	
+
 	output[0] = 0;
-	
+
 	while ((hint = hints_enum(name, NULL, &pos))) {
 		if ((found == 0) || (str_length(hint) > str_length(output)))
 			str_cpy(output, MAX_CMDLINE, hint);
-		
+
 		found++;
 	}
-	
+
 	/*
 	 * If the number of possible completions is more than MAX_TAB_HINTS,
@@ -242,10 +242,10 @@
 		    console_prompt_display_all_hints(indev, found);
 	}
-	
+
 	if ((found > 1) && (str_length(output) != 0)) {
 		printf("\n");
 		pos = NULL;
 		while ((hint = hints_enum(name, &help, &pos))) {
-			
+
 			if (continue_showing_hints) {
 				if (help)
@@ -253,8 +253,8 @@
 				else
 					printf("%s%s\n", name, hint);
-				
+
 				--hints_to_show;
 				++total_hints_shown;
-				
+
 				if ((hints_to_show == 0) && (total_hints_shown != found)) {
 					/* Ask user to continue */
@@ -263,20 +263,20 @@
 				}
 			}
-			
+
 			for (max_match_len_tmp = 0;
 			    (output[max_match_len_tmp] ==
 			    hint[max_match_len_tmp]) &&
 			    (max_match_len_tmp < max_match_len); ++max_match_len_tmp);
-			
+
 			max_match_len = max_match_len_tmp;
 		}
-		
+
 		/* Keep only the characters common in all completions */
 		output[max_match_len] = 0;
 	}
-	
+
 	if (found > 0)
 		str_cpy(input, size, output);
-	
+
 	free(output);
 	return found;
@@ -288,22 +288,22 @@
 	size_t end;
 	char *tmp;
-	
+
 	while (isspace(cmdline[start]))
 		start++;
-	
+
 	end = start + 1;
-	
+
 	while (!isspace(cmdline[end]))
 		end++;
-	
+
 	tmp = malloc(STR_BOUNDS(end - start + 1), 0);
-	
+
 	wstr_to_str(tmp, end - start + 1, &cmdline[start]);
-	
+
 	spinlock_lock(&cmd_lock);
-	
+
 	list_foreach(cmd_list, link, cmd_info_t, hlp) {
 		spinlock_lock(&hlp->lock);
-		
+
 		if (str_cmp(hlp->name, tmp) == 0) {
 			spinlock_unlock(&hlp->lock);
@@ -312,11 +312,11 @@
 			return hlp;
 		}
-		
+
 		spinlock_unlock(&hlp->lock);
 	}
-	
+
 	free(tmp);
 	spinlock_unlock(&cmd_lock);
-	
+
 	return NULL;
 }
@@ -325,13 +325,13 @@
 {
 	printf("%s> ", prompt);
-	
+
 	size_t position = 0;
 	wchar_t *current = history[history_pos];
 	current[0] = 0;
 	char *tmp = malloc(STR_BOUNDS(MAX_CMDLINE), 0);
-	
+
 	while (true) {
 		wchar_t ch = indev_pop_character(indev);
-		
+
 		if (ch == '\n') {
 			/* Enter */
@@ -339,10 +339,10 @@
 			break;
 		}
-		
+
 		if (ch == '\b') {
 			/* Backspace */
 			if (position == 0)
 				continue;
-			
+
 			if (wstr_remove(current, position - 1)) {
 				position--;
@@ -353,14 +353,14 @@
 			}
 		}
-		
+
 		if (ch == '\t') {
 			/* Tab completion */
-			
+
 			/* Move to the end of the word */
 			for (; (current[position] != 0) && (!isspace(current[position]));
 			    position++)
 				putchar(current[position]);
-			
-			
+
+
 			/*
 			 * Find the beginning of the word
@@ -376,11 +376,11 @@
 				    (beg > 0) && (!isspace(current[beg]));
 				    beg--);
-				
+
 				if (isspace(current[beg]))
 					beg++;
-				
+
 				wstr_to_str(tmp, position - beg + 1, current + beg);
 			}
-			
+
 			/* Count which argument number are we tabbing (narg=0 is cmd) */
 			bool sp = false;
@@ -394,8 +394,8 @@
 					sp = false;
 			}
-			
+
 			if (narg && isspace(current[0]))
 				narg--;
-			
+
 			int found;
 			if (narg == 0) {
@@ -411,5 +411,5 @@
 				    cmd->hints_enum);
 			}
-			
+
 			if (found == 0)
 				continue;
@@ -424,8 +424,8 @@
 				if (!wstr_linsert(current, ch, position + i, MAX_CMDLINE))
 					break;
-				
+
 				i++;
 			}
-			
+
 			if (found > 1) {
 				/* No unique hint, list was printed */
@@ -436,11 +436,11 @@
 				continue;
 			}
-			
+
 			/* We have a hint */
-			
+
 			printf("%ls", current + position);
 			position += str_length(tmp);
 			print_cc('\b', wstr_length(current) - position);
-			
+
 			if (position == wstr_length(current)) {
 				/* Insert a space after the last completed argument */
@@ -452,5 +452,5 @@
 			continue;
 		}
-		
+
 		if (ch == U_LEFT_ARROW) {
 			/* Left */
@@ -461,5 +461,5 @@
 			continue;
 		}
-		
+
 		if (ch == U_RIGHT_ARROW) {
 			/* Right */
@@ -470,5 +470,5 @@
 			continue;
 		}
-		
+
 		if ((ch == U_UP_ARROW) || (ch == U_DOWN_ARROW)) {
 			/* Up, down */
@@ -476,5 +476,5 @@
 			print_cc(' ', wstr_length(current));
 			print_cc('\b', wstr_length(current));
-			
+
 			if (ch == U_UP_ARROW) {
 				/* Up */
@@ -493,5 +493,5 @@
 			continue;
 		}
-		
+
 		if (ch == U_HOME_ARROW) {
 			/* Home */
@@ -500,5 +500,5 @@
 			continue;
 		}
-		
+
 		if (ch == U_END_ARROW) {
 			/* End */
@@ -507,10 +507,10 @@
 			continue;
 		}
-		
+
 		if (ch == U_DELETE) {
 			/* Delete */
 			if (position == wstr_length(current))
 				continue;
-			
+
 			if (wstr_remove(current, position)) {
 				printf("%ls ", current + position);
@@ -519,5 +519,5 @@
 			continue;
 		}
-		
+
 		if (wstr_linsert(current, ch, position, MAX_CMDLINE)) {
 			printf("%ls", current + position);
@@ -526,10 +526,10 @@
 		}
 	}
-	
+
 	if (wstr_length(current) > 0) {
 		history_pos++;
 		history_pos = history_pos % KCONSOLE_HISTORY;
 	}
-	
+
 	free(tmp);
 	return current;
@@ -546,5 +546,5 @@
 	bool isaddr = false;
 	bool isptr = false;
-	
+
 	/* If we get a name, try to find it in symbol table */
 	if (text[0] == '&') {
@@ -557,9 +557,9 @@
 		len--;
 	}
-	
+
 	if ((text[0] < '0') || (text[0] > '9')) {
 		char symname[MAX_SYMBOL_NAME];
 		str_ncpy(symname, MAX_SYMBOL_NAME, text, len + 1);
-		
+
 		uintptr_t symaddr;
 		errno_t rc = symtab_addr_lookup(symname, &symaddr);
@@ -611,5 +611,5 @@
 		}
 	}
-	
+
 	return true;
 }
@@ -635,10 +635,10 @@
 	assert(start != NULL);
 	assert(end != NULL);
-	
+
 	bool found_start = false;
 	size_t offset = *start;
 	size_t prev = *start;
 	wchar_t ch;
-	
+
 	while ((ch = str_decode(cmdline, &offset, size)) != 0) {
 		if (!found_start) {
@@ -651,9 +651,9 @@
 				break;
 		}
-		
+
 		prev = offset;
 	}
 	*end = prev;
-	
+
 	return found_start;
 }
@@ -676,10 +676,10 @@
 	}
 	spinlock_lock(&cmd_lock);
-	
+
 	cmd_info_t *cmd = NULL;
-	
+
 	list_foreach(cmd_list, link, cmd_info_t, hlp) {
 		spinlock_lock(&hlp->lock);
-		
+
 		if (str_lcmp(hlp->name, cmdline + start,
 		    max(str_length(hlp->name),
@@ -688,10 +688,10 @@
 			break;
 		}
-		
+
 		spinlock_unlock(&hlp->lock);
 	}
-	
+
 	spinlock_unlock(&cmd_lock);
-	
+
 	if (!cmd) {
 		/* Unknown command. */
@@ -699,7 +699,7 @@
 		return NULL;
 	}
-	
+
 	/* cmd == hlp is locked */
-	
+
 	/*
 	 * The command line must be further analyzed and
@@ -708,10 +708,10 @@
 	 * structure.
 	 */
-	
+
 	bool error = false;
 	size_t i;
 	for (i = 0; i < cmd->argc; i++) {
 		char *buf;
-		
+
 		start = end;
 		if (!parse_argument(cmdline, size, &start, &end)) {
@@ -721,10 +721,10 @@
 				continue;
 			}
-			
+
 			printf("Too few arguments.\n");
 			spinlock_unlock(&cmd->lock);
 			return NULL;
 		}
-		
+
 		switch (cmd->argv[i].type) {
 		case ARG_TYPE_STRING:
@@ -767,10 +767,10 @@
 		}
 	}
-	
+
 	if (error) {
 		spinlock_unlock(&cmd->lock);
 		return NULL;
 	}
-	
+
 	start = end;
 	if (parse_argument(cmdline, size, &start, &end)) {
@@ -779,5 +779,5 @@
 		return NULL;
 	}
-	
+
 	spinlock_unlock(&cmd->lock);
 	return cmd;
@@ -798,13 +798,13 @@
 		return;
 	}
-	
+
 	if (msg)
 		printf("%s", msg);
-	
+
 	if (kcon)
 		indev_pop_character(stdin);
 	else
 		printf("Type \"exit\" to leave the console.\n");
-	
+
 	char *cmdline = malloc(STR_BOUNDS(MAX_CMDLINE), 0);
 	while (true) {
@@ -813,14 +813,14 @@
 		if (!len)
 			continue;
-		
+
 		wstr_to_str(cmdline, STR_BOUNDS(MAX_CMDLINE), tmp);
-		
+
 		if ((!kcon) && (len == 4) && (str_lcmp(cmdline, "exit", 4) == 0))
 			break;
-		
+
 		cmd_info_t *cmd_info = parse_cmdline(cmdline, STR_BOUNDS(MAX_CMDLINE));
 		if (!cmd_info)
 			continue;
-		
+
 		(void) cmd_info->func(cmd_info->argv);
 	}
