From: Adam Dickmeiss Date: Fri, 16 Nov 2001 10:18:20 +0000 (+0000) Subject: Fix: Remove new-lines from commands in ZOOM shell. X-Git-Tag: YAZ.1.8.3~5 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=c82a7ebce851c96c8c769c2ec4f4b2121a446e19;p=yaz-moved-to-github.git Fix: Remove new-lines from commands in ZOOM shell. --- diff --git a/zoom/zoom-c.c b/zoom/zoom-c.c index 04fb7e8..d3dbe06 100644 --- a/zoom/zoom-c.c +++ b/zoom/zoom-c.c @@ -1,5 +1,5 @@ /* - * $Id: zoom-c.c,v 1.9 2001-11-16 09:52:39 adam Exp $ + * $Id: zoom-c.c,v 1.10 2001-11-16 10:18:20 adam Exp $ * * ZOOM layer for C, connections, result sets, queries. */ @@ -770,7 +770,7 @@ static void response_diag (Z3950_connection c, Z_DiagRec *p) c->error = *r->condition; } -Z3950_record Z3950_record_dup (const Z3950_record srec) +Z3950_record Z3950_record_dup (Z3950_record srec) { char *buf; int size; diff --git a/zoom/zoomsh.c b/zoom/zoomsh.c index f0bcadd..e403a17 100644 --- a/zoom/zoomsh.c +++ b/zoom/zoomsh.c @@ -1,5 +1,5 @@ /* - * $Id: zoomsh.c,v 1.5 2001-11-16 09:52:39 adam Exp $ + * $Id: zoomsh.c,v 1.6 2001-11-16 10:18:20 adam Exp $ * * ZOOM-C Shell */ @@ -332,6 +332,7 @@ void shell(Z3950_connection *c, Z3950_resultset *r, Z3950_options options) while (1) { char buf[1000]; + char *cp; const char *bp = buf; #if HAVE_READLINE_READLINE_H char* line_in; @@ -353,6 +354,8 @@ void shell(Z3950_connection *c, Z3950_resultset *r, Z3950_options options) if (!fgets (buf, 999, stdin)) break; #endif + if ((cp = strchr(buf, '\n'))) + *cp = '\0'; if (!cmd_parse (c, r, options, &bp)) break; }