Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > 95e2d750b941652dad4c688ffc319be3 > files > 9

curl-7.20.1-5.fc13.src.rpm

 CHANGES    |    5 +++++
 src/main.c |    5 ++++-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/CHANGES b/CHANGES
index fad0bc4..ac2f939 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,11 @@
 
                                   Changelog
 
+Kamil Dudka (15 Aug 2010)
+- curl -T: ignore file size of special files
+  
+  original bug report at https://bugzilla.redhat.com/622520
+
 Kamil Dudka (12 Aug 2010)
 - typecheck-gcc: work around gcc upstream bug #32061
   
diff --git a/src/main.c b/src/main.c
index d532846..7106bac 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4757,7 +4757,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)) {