Rev 3403 | Rev 4341 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3403 | Rev 4338 | ||
|---|---|---|---|
| Line 31... | Line 31... | ||
| 31 | 31 | ||
| 32 | #include <stdio.h> |
32 | #include <stdio.h> |
| 33 | #include <stdlib.h> |
33 | #include <stdlib.h> |
| 34 | #include <string.h> |
34 | #include <string.h> |
| 35 | #include <io/stream.h> |
35 | #include <io/stream.h> |
| - | 36 | #include <console.h> |
|
| 36 | 37 | ||
| 37 | #include "config.h" |
38 | #include "config.h" |
| 38 | #include "util.h" |
39 | #include "util.h" |
| 39 | #include "scli.h" |
40 | #include "scli.h" |
| 40 | #include "input.h" |
41 | #include "input.h" |
| Line 162... | Line 163... | ||
| 162 | void get_input(cliuser_t *usr) |
163 | void get_input(cliuser_t *usr) |
| 163 | { |
164 | { |
| 164 | char line[INPUT_MAX]; |
165 | char line[INPUT_MAX]; |
| 165 | size_t len = 0; |
166 | size_t len = 0; |
| 166 | 167 | ||
| - | 168 | console_set_style(STYLE_EMPHASIS); |
|
| 167 | printf("%s", usr->prompt); |
169 | printf("%s", usr->prompt); |
| - | 170 | console_set_style(STYLE_NORMAL); |
|
| - | 171 | ||
| 168 | read_line(line, INPUT_MAX); |
172 | read_line(line, INPUT_MAX); |
| 169 | len = strlen(line); |
173 | len = strlen(line); |
| 170 | /* Make sure we don't have rubbish or a C/R happy user */ |
174 | /* Make sure we don't have rubbish or a C/R happy user */ |
| 171 | if (len == 0 || line[0] == '\n') |
175 | if (len == 0 || line[0] == '\n') |
| 172 | return; |
176 | return; |