From: Kamil Dudka Date: Thu, 12 Aug 2010 19:45:31 +0000 (+0200) Subject: curl -T: ignore file size of special files X-Git-Tag: curl-7_21_2~174 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5907777153932e27805b192443dfe2845327a8c4;p=thirdparty%2Fcurl.git curl -T: ignore file size of special files original bug report at https://bugzilla.redhat.com/622520 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d33314b00d..080e572e94 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -9,7 +9,7 @@ Curl and libcurl 7.21.2 This release includes the following changes: - o + o curl -T: ignore file size of special files This release includes the following bugfixes: diff --git a/src/main.c b/src/main.c index 5585c1755b..3b78d602f6 100644 --- a/src/main.c +++ b/src/main.c @@ -4925,7 +4925,10 @@ operate(struct Configurable *config, int argc, argv_item_t argv[]) goto quit_urls; } infdopen=TRUE; - uploadfilesize=fileinfo.st_size; + + /* we ignore file size for char/block devices, sockets, etc. */ + if(S_IFREG == (fileinfo.st_mode & S_IFMT)) + uploadfilesize=fileinfo.st_size; } else if(uploadfile && stdin_upload(uploadfile)) {