projects
/
profile
/
ivi
/
murphy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40afe98
)
console: don't crash on unterminated quotes, reset errors between commands.
author
Krisztian Litkey
<kli@iki.fi>
Fri, 5 Jul 2013 18:56:00 +0000
(21:56 +0300)
committer
Krisztian Litkey
<kli@iki.fi>
Fri, 5 Jul 2013 19:02:46 +0000
(22:02 +0300)
src/core/console.c
patch
|
blob
|
history
diff --git
a/src/core/console.c
b/src/core/console.c
index
d0e1afc
..
eef43a1
100644
(file)
--- a/
src/core/console.c
+++ b/
src/core/console.c
@@
-532,6
+532,7
@@
static ssize_t input_evt(mrp_console_t *mc, void *buf, size_t size)
c->in.next = c->in.buf;
c->in.in = c->in.buf + len;
c->in.line = 1;
+ c->in.error = 0;
*c->in.in = '\0';
argv = args + 2;
@@
-544,9
+545,11
@@
static ssize_t input_evt(mrp_console_t *mc, void *buf, size_t size)
* decent input processing.
*/
- if (argc < 0)
+ if (argc < 0)
{
fprintf(c->stderr, "failed to parse command: '%.*s'\n",
(int)size, (char *)buf);
+ return -1;
+ }
else if (argc == 0)
goto prompt;