From c82a7ebce851c96c8c769c2ec4f4b2121a446e19 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 16 Nov 2001 10:18:20 +0000 Subject: [PATCH] Fix: Remove new-lines from commands in ZOOM shell. --- zoom/zoom-c.c | 4 ++-- zoom/zoomsh.c | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) 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; } -- 1.7.10.4