Rev 4341 | Rev 4348 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4341 | Rev 4344 | ||
---|---|---|---|
Line 92... | Line 92... | ||
92 | free(tmp); |
92 | free(tmp); |
93 | 93 | ||
94 | return rc; |
94 | return rc; |
95 | } |
95 | } |
96 | 96 | ||
97 | /* Borrowed from Jiri Svoboda's 'cli' uspace app */ |
- | |
98 | static void read_line(char *buffer, int n) |
97 | static void read_line(char *buffer, int n) |
99 | { |
98 | { |
100 | char c; |
99 | char c; |
101 | int chars; |
100 | int chars; |
102 | 101 | ||
Line 112... | Line 111... | ||
112 | putchar('\b'); |
111 | putchar('\b'); |
113 | --chars; |
112 | --chars; |
114 | } |
113 | } |
115 | continue; |
114 | continue; |
116 | } |
115 | } |
- | 116 | if (c >= ' ') { |
|
117 | putchar(c); |
117 | putchar(c); |
118 | buffer[chars++] = c; |
118 | buffer[chars++] = c; |
- | 119 | } |
|
119 | } |
120 | } |
120 | putchar('\n'); |
121 | putchar('\n'); |
121 | buffer[chars] = '\0'; |
122 | buffer[chars] = '\0'; |
122 | } |
123 | } |
123 | 124 |