1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

shell: accept UTF8 input

This commit is contained in:
René Kijewski 2014-03-10 13:47:33 +01:00
parent 0c9fd83693
commit 3f289760bf
2 changed files with 5 additions and 5 deletions

View File

@ -97,7 +97,7 @@ static void handle_input_line(shell_t *shell, char *line)
char *pos = line;
int contains_esc_seq = 0;
while (1) {
if (*pos > ' ') {
if ((unsigned char) *pos > ' ') {
/* found an argument */
if (*pos == '"' || *pos == '\'') {
/* it's a quoted argument */
@ -119,7 +119,7 @@ static void handle_input_line(shell_t *shell, char *line)
continue;
}
} while (*pos != quote_char);
if (pos[1] > ' ') {
if ((unsigned char) pos[1] > ' ') {
puts(INCORRECT_QUOTING);
return;
}
@ -141,7 +141,7 @@ static void handle_input_line(shell_t *shell, char *line)
puts(INCORRECT_QUOTING);
return;
}
} while (*pos > ' ');
} while ((unsigned char) *pos > ' ');
}
/* count the number of arguments we got */

View File

@ -52,9 +52,9 @@ static void print_echo(int argc, char **argv)
static int shell_readc(void)
{
char c = 0;
char c;
posix_read(uart0_handler_pid, &c, 1);
return c;
return (unsigned char) c;
}
static void shell_putchar(int c)