From d9af31fa7067266b3bad4a734c0b61ac6bc5d67d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 9 Apr 2010 10:47:04 +0200 Subject: [PATCH] yaz-client: show uses last position if omitted The show command has always used last position if omitted - except that this was messed up in YAZ 4.0.2. --- client/client.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/client.c b/client/client.c index 3c68c58..144c0f4 100644 --- a/client/client.c +++ b/client/client.c @@ -2850,6 +2850,7 @@ static int parse_show_args(const char *arg_c, char *setstring, Odr_int *start, Odr_int *number) { char *end_ptr; + Odr_int start_position; if (setnumber >= 0) sprintf(setstring, "%d", setnumber); @@ -2861,8 +2862,11 @@ static int parse_show_args(const char *arg_c, char *setstring, *number = last_hit_count; *start = 1; } - *start = odr_strtol(arg_c, &end_ptr, 10); - if (end_ptr == arg_c || *end_ptr == '\0') + start_position = odr_strtol(arg_c, &end_ptr, 10); + if (end_ptr == arg_c) + return 1; + *start = start_position; + if (*end_ptr == '\0') return 1; while (isspace(*(unsigned char *)end_ptr)) end_ptr++; -- 1.7.10.4