From: Adam Dickmeiss Date: Fri, 9 Apr 2010 08:47:04 +0000 (+0200) Subject: yaz-client: show uses last position if omitted X-Git-Tag: v4.0.3~6 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=d9af31fa7067266b3bad4a734c0b61ac6bc5d67d;p=yaz-moved-to-github.git 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. --- 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++;