cURL / Mailing Lists / curl-users / Single Mail

curl-users

allow a range of one

From: nick open.source <nick.open.source_at_googlemail.com>
Date: Fri, 9 Mar 2007 21:34:55 +0000

Currently curl throws an error if you use a range where the lower and upper
values are the same.
It's a simple change to allow a range of one, as shown below.

The reason for this request, is when using curl with the # facility in the
output file name, if you want to reduce a range to one, currently you have
to fiddle with all the #es in the output names.
Quick example:

curl ... domain.com/[1-7]/aaa/[1-5].txt -o domain_#1_aaa_#2.txt

if you then want to tweak it to read in the 8th set currently you have to
change it to

curl ... domain.com/8/aaa/[1-5].txt -o domain_8_aaa_#1.txt

With my minor fix, you could use

curl ... domain.com/[8-8]/aaa/[1-5].txt -o domain_#1_aaa_#2.txt

The fix is:
diff -r curl/curl-7.16.1/src/urlglob.c curl_v7160/curl-7.16.0/src/urlglob.c
217c217
< if ((rc < 2) || (min_n >= max_n)) {

---
>     if ((rc < 2) || (min_n > max_n)) { /* NICK > was >= */
This is my first attempt on a open source project, so I hope I've followed
all the rules.
Let me know if I'm supposed to do anything else other that post a change in
this mailing list.
Nick.
Received on 2007-03-09