[pan2/testing: 187/279] fixed stupid uuencode.c bug



commit 23f2e521ce654f99dc9cc88129331dd2cda182e5
Author: Heinrich MÃller <sphemuel stud informatik uni-erlangen de>
Date:   Fri Jul 29 13:33:10 2011 +0200

    fixed stupid uuencode.c bug

 pan/tasks/task-upload.cc |    2 ++
 uulib/uuencode.c         |   30 +++++++++++++++++-------------
 2 files changed, 19 insertions(+), 13 deletions(-)
---
diff --git a/pan/tasks/task-upload.cc b/pan/tasks/task-upload.cc
index d21803f..9ed80a3 100644
--- a/pan/tasks/task-upload.cc
+++ b/pan/tasks/task-upload.cc
@@ -178,6 +178,8 @@ TaskUpload :: update_work (NNTP* checkin_pending)
   }
   else if (_encoder_has_run && !_needed.empty())
   {
+//    _state.set_completed();
+//    set_finished(_queue_pos);
     _state.set_need_nntp(_server);
   }
   else if (_needed.empty())
diff --git a/uulib/uuencode.c b/uulib/uuencode.c
index 73f1bdc..c50a6b0 100644
--- a/uulib/uuencode.c
+++ b/uulib/uuencode.c
@@ -1630,23 +1630,24 @@ UUEncodePartial_byFSize (FILE *outfile, FILE *infile,
       if (infile==NULL)
         {
           if (stat (infname, &finfo) == -1)
-            {
-              UUMessage (uuencode_id, __LINE__, UUMSG_ERROR,
-                         uustring (S_NOT_STAT_FILE),
-                         infname, strerror (uu_errno=errno));
-              return UURET_IOERR;
-            }
+          {
+            UUMessage (uuencode_id, __LINE__, UUMSG_ERROR,
+                       uustring (S_NOT_STAT_FILE),
+                       infname, strerror (uu_errno=errno));
+            return UURET_IOERR;
+          }
           if ((theifile = fopen (infname, "rb")) == NULL)
-            {
-              UUMessage (uuencode_id, __LINE__, UUMSG_ERROR,
-                         uustring (S_NOT_OPEN_FILE),
-                         infname, strerror (uu_errno=errno));
-              return UURET_IOERR;
-            }
+          {
+            UUMessage (uuencode_id, __LINE__, UUMSG_ERROR,
+                       uustring (S_NOT_OPEN_FILE),
+                       infname, strerror (uu_errno=errno));
+            return UURET_IOERR;
+          }
+
           if (finfo.st_size <= bpf)
             numparts = 1;
           else
-            numparts = (int) (ceill(finfo.st_size / bpf));
+            numparts = (int) (ceil((double)finfo.st_size / (double)bpf));
 
           themode  = (filemode) ? filemode : ((int) finfo.st_mode & 0777);
           thesize  = (long) finfo.st_size;
@@ -1766,6 +1767,9 @@ UUEncodePartial_byFSize (FILE *outfile, FILE *infile,
         }
       else
         {
+
+          printf("parts of %s %ld\n",progress.curfile, progress.numparts);
+
           if (progress.totsize == -1)
             {
               fprintf (outfile, "=ybegin line=128 name=%s%s",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]