X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/92e05dd95e96c03599e48cfa01ca900c41a15afa..7b32e917cba7c78d74297b2aefaf823ed262a921:/lib/eclient.c diff --git a/lib/eclient.c b/lib/eclient.c index 2bf86e9..2d85fb9 100644 --- a/lib/eclient.c +++ b/lib/eclient.c @@ -819,13 +819,19 @@ static void stash_command(disorder_eclient *c, /* Command support ***********************************************************/ -/* for commands with a simple string response */ +/* for commands with a quoted string response */ static void string_response_opcallback(disorder_eclient *c, struct operation *op) { D(("string_response_callback")); if(c->rc / 100 == 2) { - if(op->completed) - ((disorder_eclient_string_response *)op->completed)(op->v, c->line + 4); + if(op->completed) { + char **rr = split(c->line + 4, 0, SPLIT_QUOTES, 0, 0); + + if(rr && *rr) + ((disorder_eclient_string_response *)op->completed)(op->v, *rr); + else + protocol_error(c, op, c->rc, "%s: %s", c->ident, c->line); + } } else protocol_error(c, op, c->rc, "%s: %s", c->ident, c->line); }