[pan2: 107/268] bla



commit f5f4e3530cac0f32bcb49472df6a30b57511fdea
Author: Heinrich MÃller <sphemuel stud informatik uni-erlangen de>
Date:   Mon Jul 4 12:12:10 2011 +0200

    bla

 pan/data/encode-cache.cc |   13 +++-
 pan/gui/post-ui.cc       |    2 +
 pan/gui/prefs-ui.cc      |    2 +-
 pan/gui/server-ui.cc     |    2 +-
 pan/tasks/encoder.cc     |    6 +-
 pan/tasks/task-upload.cc |    7 +-
 uulib/uudeview.h         |   10 ++--
 uulib/uuencode.c         |  152 +++++++++++++++++++++++-----------------------
 uulib/uulib.c            |   24 ++++----
 9 files changed, 112 insertions(+), 106 deletions(-)
---
diff --git a/pan/data/encode-cache.cc b/pan/data/encode-cache.cc
index 473ddea..b38d46e 100644
--- a/pan/data/encode-cache.cc
+++ b/pan/data/encode-cache.cc
@@ -189,13 +189,22 @@ EncodeCache :: clear ()
 void
 EncodeCache :: get_data(std::string& data, const Quark& where)
 {
-  char buf[4096];
+  char buf[4096], buf2[4096];
   get_filename(buf, where);
   std::ifstream in(buf, std::ios::in);
   std::stringstream out;
 
-  while (in.getline(buf,sizeof(buf)))
+  char * path = g_path_get_basename (buf);
+  g_snprintf(buf2,sizeof(buf2), "/home/imhotep/%s",path);
+
+  std::ofstream dbg(buf2, std::ios::out);
+
+  while (in.getline(buf,sizeof(buf))) {
+    dbg << buf <<"\n";
     out << buf << "\n";
+  }
+
+  dbg.close();
 
   in.close();
   data = out.str();
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index caddaf9..5e143b3 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -783,6 +783,8 @@ PostUI :: send_and_save_now ()
   } else
     _save_file = prompt_user_for_upload_nzb_dir (GTK_WINDOW(_root), _prefs);
 
+  if (_save_file.empty()) return;
+
   GMimeMessage * message (new_message_from_ui (POSTING));
   if (!maybe_post_message (message))
     g_object_unref (G_OBJECT(message));
diff --git a/pan/gui/prefs-ui.cc b/pan/gui/prefs-ui.cc
index b0b7b89..4cf503f 100644
--- a/pan/gui/prefs-ui.cc
+++ b/pan/gui/prefs-ui.cc
@@ -628,7 +628,7 @@ PrefsDialog :: PrefsDialog (Prefs& prefs, GtkWindow* parent):
   HIG :: workarea_add_wide_control (t, &row, w);
   HIG :: workarea_add_section_title (t, &row, _("Upload Subject Line Appearance"));
   HIG :: workarea_add_section_spacer (t, row, 4);
-  w = new_spin_button ("upload-option-lpf", 5000, 50000, prefs);
+  w = new_spin_button ("upload-option-lpf", 4000, 50000, prefs);
   l = gtk_label_new(_("Default Lines per File (for yEnc Encoder)"));
   gtk_misc_set_alignment (GTK_MISC(l), 0.0, 0.5);
   gtk_label_set_mnemonic_widget(GTK_LABEL(l), w);
diff --git a/pan/gui/server-ui.cc b/pan/gui/server-ui.cc
index 6870b7d..a118661 100644
--- a/pan/gui/server-ui.cc
+++ b/pan/gui/server-ui.cc
@@ -252,7 +252,7 @@ pan :: server_edit_dialog_new (Data& data, Queue& queue, GtkWindow * window, con
     HIG::workarea_add_section_spacer (t, row, 2);
 
     // max connections
-    const int DEFAULT_MAX_PER_SERVER (20);
+    const int DEFAULT_MAX_PER_SERVER (4);
     a = GTK_ADJUSTMENT (gtk_adjustment_new (1.0, 0.0, DEFAULT_MAX_PER_SERVER, 1.0, 1.0, 0.0));
     d->connection_limit_spin = w = gtk_spin_button_new (GTK_ADJUSTMENT(a), 1.0, 0u);
     HIG::workarea_add_row (t, &row, _("Connection _Limit:"), w, NULL);
diff --git a/pan/tasks/encoder.cc b/pan/tasks/encoder.cc
index 8c9446b..3aeadc3 100644
--- a/pan/tasks/encoder.cc
+++ b/pan/tasks/encoder.cc
@@ -98,7 +98,6 @@ Encoder :: do_work()
   const int bufsz = 4096;
   char buf[bufsz], buf2[bufsz];
   int cnt(1);
-  crc32_t crc;
   struct stat sb;
   std::string s;
   FILE* outfile, * infile ;
@@ -127,8 +126,6 @@ Encoder :: do_work()
       int enc(YENC_ENCODED);
       std::ofstream out;
       std::string txt;
-      /* (encoding!=UU_ENCODED&&encoding!=XX_ENCODED&&encoding!=B64ENCODED&&
-     encoding!=PT_ENCODED&&encoding!=QP_ENCODED&&encoding!=YENC_ENCODED)) { */
       switch (encode_mode)
       {
           case TaskUpload::YENC:
@@ -159,7 +156,8 @@ Encoder :: do_work()
         continue;
       }
 
-      res = UUEncodePartial (fp, NULL, (char*)filename.c_str(), enc , (char*)basename.c_str(), NULL, 0644, cnt, lpf,&crc);
+      crc32_t unused;
+      res = UUEncodePartial (fp, NULL, (char*)filename.c_str(), enc , (char*)basename.c_str(), NULL, 0644, cnt, lpf, &unused);
 
       if (fp) fclose(fp);
 _no_encode:
diff --git a/pan/tasks/task-upload.cc b/pan/tasks/task-upload.cc
index ee7e254..7e58546 100644
--- a/pan/tasks/task-upload.cc
+++ b/pan/tasks/task-upload.cc
@@ -343,8 +343,7 @@ TaskUpload :: use_encoder (Encoder* encoder)
   init_steps(100);
   _state.set_working();
 
-    ///TODO support other encode modes by choice of user
-  _encoder->enqueue (this, &_cache, &_article, _filename, _basename, _master_subject, _lpf, _encode_mode);
+  _encoder->enqueue (this, &_cache, &_article, _filename, _basename, _master_subject, 5000, YENC);
   debug ("encoder thread was free, enqueued work");
 }
 
@@ -402,6 +401,6 @@ TaskUpload :: ~TaskUpload ()
       _encoder->cancel_silently();
 
   g_object_unref (G_OBJECT(_msg));
-  _cache.release(_mids);
-  _cache.resize();
+//  _cache.release(_mids);
+//  _cache.resize();
 }
diff --git a/uulib/uudeview.h b/uulib/uudeview.h
index 428eaa1..804f58e 100644
--- a/uulib/uudeview.h
+++ b/uulib/uudeview.h
@@ -172,7 +172,7 @@ typedef struct {
   long foffset;			/* file offset -- internal use only        */
   long totsize;			/* file total size -- internal use only    */
 } uuprogress;
-
+  
 
 /*
  * Externally visible Functions
@@ -191,7 +191,7 @@ int	UUEXPORT UUGetOption		_ANSI_ARGS_((int, int *, char *, int));
 int	UUEXPORT UUSetOption		_ANSI_ARGS_((int, int, char *));
 char *	UUEXPORT UUstrerror		_ANSI_ARGS_((int));
 int	UUEXPORT UUSetMsgCallback	_ANSI_ARGS_((void *,
-						     void (*) (void *,
+						     void (*) (void *, 
 							       char *,
 							       int)));
 int	UUEXPORT UUSetBusyCallback	_ANSI_ARGS_((void *,
@@ -213,7 +213,7 @@ int	UUEXPORT UUDecodeToTemp		_ANSI_ARGS_((uulist *));
 int	UUEXPORT UURemoveTemp		_ANSI_ARGS_((uulist *));
 int	UUEXPORT UUDecodeFile		_ANSI_ARGS_((uulist *, char *));
 int	UUEXPORT UUInfoFile		_ANSI_ARGS_((uulist *, void *,
-						     int (*) (void *,
+						     int (*) (void *, 
 							      char *)));
 int	UUEXPORT UUSmerge		_ANSI_ARGS_((int));
 int	UUEXPORT UUCleanUp		_ANSI_ARGS_((void));
@@ -242,8 +242,8 @@ int	UUEXPORT UUE_PrepSingle		_ANSI_ARGS_((FILE *, FILE *,
 int	UUEXPORT UUE_PrepPartial	_ANSI_ARGS_((FILE *, FILE *,
 						     char *, int,
 						     char *, int,
-						     int, long, long,
-						     char *, char*, char*,  int));
+						     int, long, long, char *,
+						     char *, char *, int));
 
 int	UUEXPORT UUE_PrepSingleExt	_ANSI_ARGS_((FILE *, FILE *,
 						     char *, int,
diff --git a/uulib/uuencode.c b/uulib/uuencode.c
index 20e1f37..691879a 100644
--- a/uulib/uuencode.c
+++ b/uulib/uuencode.c
@@ -135,7 +135,7 @@ unsigned char UUEncodeTable[64] = {
   'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
   'X', 'Y', 'Z', '[', '\\',']', '^', '_'
 };
-
+  
 
 unsigned char B64EncodeTable[64] = {
   'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
@@ -162,11 +162,11 @@ unsigned char XXEncodeTable[64] = {
 unsigned char BHEncodeTable[64] = {
   '!', '"', '#', '$', '%', '&', '\'', '(',
   ')', '*', '+', ',', '-', '0', '1', '2',
-  '3', '4', '5', '6', '8', '9', '@', 'A',
-  'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
-  'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R',
-  'S', 'T', 'U', 'V', 'X', 'Y', 'Z', '[',
-  '`', 'a', 'b', 'c', 'd', 'e', 'f', 'h',
+  '3', '4', '5', '6', '8', '9', '@', 'A', 
+  'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 
+  'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 
+  'S', 'T', 'U', 'V', 'X', 'Y', 'Z', '[', 
+  '`', 'a', 'b', 'c', 'd', 'e', 'f', 'h', 
   'i', 'j', 'k', 'l', 'm', 'p', 'q', 'r'
 };
 
@@ -242,7 +242,7 @@ char *uuestr_otemp;
  * Encode one part of the data stream
  */
 
-static int
+static int 
 UUEncodeStream (FILE *outfile, FILE *infile, int encoding, long linperfile, crc32_t *crc, crc32_t *pcrc)
 {
   unsigned char *itemp = (char *) uuestr_itemp;
@@ -280,7 +280,7 @@ UUEncodeStream (FILE *outfile, FILE *infile, int encoding, long linperfile, crc3
       /*
        * Busy Callback
        */
-
+      
       if (UUBUSYPOLL(ftell(infile)-progress.foffset,progress.fsize)) {
 	UUMessage (uuencode_id, __LINE__, UUMSG_NOTE,
 		   uustring (S_ENCODE_CANCEL));
@@ -386,13 +386,13 @@ UUEncodeStream (FILE *outfile, FILE *infile, int encoding, long linperfile, crc3
 
 	    *optr++ = '=';
 	    llen++;
-
+	    
 	    if (fwrite (otemp, 1, llen, outfile) != llen ||
 		fwrite ((char *) eolstring, 1,
 			strlen(eolstring), outfile) != strlen (eolstring)) {
 	      return UURET_IOERR;
 	    }
-
+	    
 	    optr = otemp;
 	    llen = 0;
 	  }
@@ -433,7 +433,7 @@ UUEncodeStream (FILE *outfile, FILE *infile, int encoding, long linperfile, crc3
       /*
        * Busy Callback
        */
-
+      
       if (UUBUSYPOLL(ftell(infile)-progress.foffset,progress.fsize)) {
 	UUMessage (uuencode_id, __LINE__, UUMSG_NOTE,
 		   uustring (S_ENCODE_CANCEL));
@@ -563,7 +563,7 @@ UUEncodeStream (FILE *outfile, FILE *infile, int encoding, long linperfile, crc3
       if (encoding == B64ENCODED) {
 	if (count - index == 2) {
 	  *optr++ = table[itemp[index] >> 2];
-	  *optr++ = table[((itemp[index  ] & 0x03) << 4) |
+	  *optr++ = table[((itemp[index  ] & 0x03) << 4) | 
 			  ((itemp[index+1] & 0xf0) >> 4)];
 	  *optr++ = table[((itemp[index+1] & 0x0f) << 2)];
 	  *optr++ = '=';
@@ -579,7 +579,7 @@ UUEncodeStream (FILE *outfile, FILE *infile, int encoding, long linperfile, crc3
       else if (encoding == UU_ENCODED || encoding == XX_ENCODED) {
 	if (count - index == 2) {
 	  *optr++ = table[itemp[index] >> 2];
-	  *optr++ = table[((itemp[index  ] & 0x03) << 4) |
+	  *optr++ = table[((itemp[index  ] & 0x03) << 4) | 
 			  ( itemp[index+1] >> 4)];
 	  *optr++ = table[((itemp[index+1] & 0x0f) << 2)];
 	  *optr++ = table[0];
@@ -630,7 +630,7 @@ UUEncodeMulti (FILE *outfile, FILE *infile, char *infname, int encoding,
   crc32_t crc;
   crc32_t *crcptr=NULL;
 
-  if (outfile==NULL ||
+  if (outfile==NULL || 
       (infile == NULL && infname==NULL) ||
       (outfname==NULL && infname==NULL) ||
       (encoding!=UU_ENCODED&&encoding!=XX_ENCODED&&encoding!=B64ENCODED&&
@@ -717,7 +717,7 @@ UUEncodeMulti (FILE *outfile, FILE *infile, char *infname, int encoding,
   if (encoding == UU_ENCODED || encoding == XX_ENCODED) {
     fprintf (outfile, "begin %o %s%s",
 	     (themode) ? themode : 0644,
-	     UUFNameFilter ((outfname)?outfname:infname),
+	     UUFNameFilter ((outfname)?outfname:infname), 
 	     eolstring);
   }
   else if (encoding == YENC_ENCODED) {
@@ -725,13 +725,13 @@ UUEncodeMulti (FILE *outfile, FILE *infile, char *infname, int encoding,
     crcptr = &crc;
     if (progress.fsize == -1) {
       fprintf (outfile, "=ybegin line=128 name=%s%s",
-	       UUFNameFilter ((outfname)?outfname:infname),
+	       UUFNameFilter ((outfname)?outfname:infname), 
 	       eolstring);
     }
     else {
       fprintf (outfile, "=ybegin line=128 size=%ld name=%s%s",
 	       progress.fsize,
-	       UUFNameFilter ((outfname)?outfname:infname),
+	       UUFNameFilter ((outfname)?outfname:infname), 
 	       eolstring);
     }
   }
@@ -748,8 +748,8 @@ UUEncodeMulti (FILE *outfile, FILE *infile, char *infname, int encoding,
   }
 
   if (encoding == UU_ENCODED || encoding == XX_ENCODED) {
-    fprintf (outfile, "%c%s",
-	     (encoding==UU_ENCODED) ? UUEncodeTable[0] : XXEncodeTable[0],
+    fprintf (outfile, "%c%s",    
+	     (encoding==UU_ENCODED) ? UUEncodeTable[0] : XXEncodeTable[0], 
 	     eolstring);
     fprintf (outfile, "end%s", eolstring);
   }
@@ -805,8 +805,8 @@ UUEncodePartial (FILE *outfile, FILE *infile,
       (infile == NULL&&infname==NULL) || outfile==NULL ||
       (encoding!=UU_ENCODED&&encoding!=XX_ENCODED&&encoding!=B64ENCODED&&
        encoding!=PT_ENCODED&&encoding!=QP_ENCODED&&encoding!=YENC_ENCODED)) {
-//    UUMessage (uuencode_id, __LINE__, UUMSG_ERROR,
-//	       uustring (S_PARM_CHECK), "UUEncodePartial()");
+    UUMessage (uuencode_id, __LINE__, UUMSG_ERROR,
+	       uustring (S_PARM_CHECK), "UUEncodePartial()");
     return UURET_ILLVAL;
   }
 
@@ -832,7 +832,7 @@ UUEncodePartial (FILE *outfile, FILE *infile,
       }
       if (linperfile <= 0)
 	numparts = 1;
-      else
+      else 
 	numparts = (int) (((long)finfo.st_size+(linperfile*bpl[encoding]-1))/
 			  (linperfile*bpl[encoding]));
 
@@ -902,7 +902,7 @@ UUEncodePartial (FILE *outfile, FILE *infile,
     }
 
     fprintf (outfile, "%s", eolstring);
-
+    
     /*
      * for the first part of UU or XX messages, print a begin line
      */
@@ -920,33 +920,33 @@ UUEncodePartial (FILE *outfile, FILE *infile,
       if (progress.totsize == -1) {
 	fprintf (outfile, "=ybegin part=%d line=128 name=%s%s",
 		 partno,
-		 UUFNameFilter ((outfname)?outfname:infname),
+		 UUFNameFilter ((outfname)?outfname:infname), 
 		 eolstring);
       }
       else {
 	fprintf (outfile, "=ybegin part=%d line=128 size=%ld name=%s%s",
 		 partno,
 		 progress.totsize,
-		 UUFNameFilter ((outfname)?outfname:infname),
+		 UUFNameFilter ((outfname)?outfname:infname), 
 		 eolstring);
       }
 
-      fprintf (outfile, "=ypart begin=%ld end=%ld%s",
+      fprintf (outfile, "=ypart begin=%d end=%d%s",
 	       (partno-1)*linperfile*128+1,
-	       (partno*linperfile*128) < progress.totsize ?
+	       (partno*linperfile*128) < progress.totsize ? 
 	       (partno*linperfile*128) : progress.totsize,
 	       eolstring);
     }
     else {
       if (progress.totsize == -1) {
 	fprintf (outfile, "=ybegin line=128 name=%s%s",
-		 UUFNameFilter ((outfname)?outfname:infname),
+		 UUFNameFilter ((outfname)?outfname:infname), 
 		 eolstring);
       }
       else {
 	fprintf (outfile, "=ybegin line=128 size=%ld name=%s%s",
 		 progress.totsize,
-		 UUFNameFilter ((outfname)?outfname:infname),
+		 UUFNameFilter ((outfname)?outfname:infname), 
 		 eolstring);
       }
     }
@@ -990,21 +990,21 @@ UUEncodePartial (FILE *outfile, FILE *infile,
 
   if (feof (theifile) &&
       (encoding == UU_ENCODED || encoding == XX_ENCODED)) {
-    fprintf (outfile, "%c%s",
-	     (encoding==UU_ENCODED) ? UUEncodeTable[0] : XXEncodeTable[0],
+    fprintf (outfile, "%c%s",    
+	     (encoding==UU_ENCODED) ? UUEncodeTable[0] : XXEncodeTable[0], 
 	     eolstring);
     fprintf (outfile, "end%s", eolstring);
   }
   else if (encoding == YENC_ENCODED) {
     if (numparts != 1) {
-      fprintf (outfile, "=yend size=%ld part=%ld pcrc32=%08lx",
-	       (partno*linperfile*128) < progress.totsize ?
+      fprintf (outfile, "=yend size=%d part=%d pcrc32=%08lx",
+	       (partno*linperfile*128) < progress.totsize ? 
 	       linperfile*128 : (progress.totsize-(partno-1)*linperfile*128),
 	       partno,
 	       pcrc);
     }
     else {
-      fprintf (outfile, "=yend size=%ld",
+      fprintf (outfile, "=yend size=%d",
 	       progress.totsize);
     }
     if (feof (theifile))
@@ -1112,7 +1112,7 @@ UUEncodeToStream (FILE *outfile, FILE *infile,
   if (encoding == UU_ENCODED || encoding == XX_ENCODED) {
     fprintf (outfile, "begin %o %s%s",
 	     (themode) ? themode : 0644,
-	     UUFNameFilter ((outfname)?outfname:infname),
+	     UUFNameFilter ((outfname)?outfname:infname), 
 	     eolstring);
   }
   else if (encoding == YENC_ENCODED) {
@@ -1120,13 +1120,13 @@ UUEncodeToStream (FILE *outfile, FILE *infile,
     crcptr = &crc;
     if (progress.fsize == -1) {
       fprintf (outfile, "=ybegin line=128 name=%s%s",
-	       UUFNameFilter ((outfname)?outfname:infname),
+	       UUFNameFilter ((outfname)?outfname:infname), 
 	       eolstring);
     }
     else {
       fprintf (outfile, "=ybegin line=128 size=%ld name=%s%s",
 	       progress.fsize,
-	       UUFNameFilter ((outfname)?outfname:infname),
+	       UUFNameFilter ((outfname)?outfname:infname), 
 	       eolstring);
     }
   }
@@ -1135,7 +1135,7 @@ UUEncodeToStream (FILE *outfile, FILE *infile,
     if (res != UURET_CANCEL) {
       UUMessage (uuencode_id, __LINE__, UUMSG_ERROR,
 		 uustring (S_ERR_ENCODING),
-		 UUFNameFilter ((infname)?infname:outfname),
+		 UUFNameFilter ((infname)?infname:outfname), 
 		 (res==UURET_IOERR)?strerror(uu_errno):UUstrerror (res));
     }
     progress.action = 0;
@@ -1143,8 +1143,8 @@ UUEncodeToStream (FILE *outfile, FILE *infile,
   }
 
   if (encoding == UU_ENCODED || encoding == XX_ENCODED) {
-    fprintf (outfile, "%c%s",
-	     (encoding==UU_ENCODED) ? UUEncodeTable[0] : XXEncodeTable[0],
+    fprintf (outfile, "%c%s",    
+	     (encoding==UU_ENCODED) ? UUEncodeTable[0] : XXEncodeTable[0], 
 	     eolstring);
     fprintf (outfile, "end%s", eolstring);
   }
@@ -1212,7 +1212,7 @@ UUEncodeToFile (FILE *infile, char *infname, int encoding,
       sprintf (oname, "%s", diskname);
     }
     else {
-      len = ((uusavepath)?strlen(uusavepath):0) + strlen (diskname)
+      len = ((uusavepath)?strlen(uusavepath):0) + strlen (diskname) 
 	+ ((uuencodeext)?strlen(uuencodeext):0) + 5;
 
       if ((oname = malloc (len)) == NULL) {
@@ -1224,7 +1224,7 @@ UUEncodeToFile (FILE *infile, char *infname, int encoding,
     }
   }
   else {
-    len = ((uusavepath) ? strlen (uusavepath) : 0) +
+    len = ((uusavepath) ? strlen (uusavepath) : 0) + 
       strlen(UUFNameFilter(infname)) +
 	((uuencodeext)?strlen(uuencodeext):0) + 5;
 
@@ -1234,7 +1234,7 @@ UUEncodeToFile (FILE *infile, char *infname, int encoding,
       return UURET_NOMEM;
     }
     optr = UUFNameFilter (infname);
-    sprintf (oname, "%s%s",
+    sprintf (oname, "%s%s", 
 	     (uusavepath)?uusavepath:"",
 	     (*optr=='.')?optr+1:optr);
   }
@@ -1275,7 +1275,7 @@ UUEncodeToFile (FILE *infile, char *infname, int encoding,
     }
     if (linperfile <= 0)
       numparts = 1;
-    else
+    else 
       numparts = (int) (((long)finfo.st_size + (linperfile*bpl[encoding]-1)) /
 			(linperfile*bpl[encoding]));
 
@@ -1313,7 +1313,7 @@ UUEncodeToFile (FILE *infile, char *infname, int encoding,
      */
     if (progress.numparts==1 && progress.totsize!=-1 && uuencodeext!=NULL)
       strcpy  (optr, uuencodeext);
-    else
+    else 
       sprintf (optr, "%03d", part);
 
     /*
@@ -1380,7 +1380,7 @@ UUEncodeToFile (FILE *infile, char *infname, int encoding,
     if (part==1 && (encoding == UU_ENCODED || encoding == XX_ENCODED)) {
       fprintf (outfile, "begin %o %s%s",
 	       (filemode)?filemode : 0644,
-	       UUFNameFilter ((outfname)?outfname:infname),
+	       UUFNameFilter ((outfname)?outfname:infname), 
 	       eolstring);
     }
     else if (encoding == YENC_ENCODED) {
@@ -1394,33 +1394,33 @@ UUEncodeToFile (FILE *infile, char *infname, int encoding,
 	if (progress.totsize == -1) {
 	  fprintf (outfile, "=ybegin part=%d line=128 name=%s%s",
 		   part,
-		   UUFNameFilter ((outfname)?outfname:infname),
+		   UUFNameFilter ((outfname)?outfname:infname), 
 		   eolstring);
 	}
 	else {
 	  fprintf (outfile, "=ybegin part=%d line=128 size=%ld name=%s%s",
 		   part,
 		   progress.totsize,
-		   UUFNameFilter ((outfname)?outfname:infname),
+		   UUFNameFilter ((outfname)?outfname:infname), 
 		   eolstring);
 	}
 
-	fprintf (outfile, "=ypart begin=%ld end=%ld%s",
+	fprintf (outfile, "=ypart begin=%d end=%d%s",
 		 (part-1)*linperfile*128+1,
-		 (part*linperfile*128) < progress.totsize ?
+		 (part*linperfile*128) < progress.totsize ? 
 		 (part*linperfile*128) : progress.totsize,
 		 eolstring);
       }
       else {
 	if (progress.totsize == -1) {
 	  fprintf (outfile, "=ybegin line=128 name=%s%s",
-		   UUFNameFilter ((outfname)?outfname:infname),
+		   UUFNameFilter ((outfname)?outfname:infname), 
 		   eolstring);
 	}
 	else {
 	  fprintf (outfile, "=ybegin line=128 size=%ld name=%s%s",
 		   progress.totsize,
-		   UUFNameFilter ((outfname)?outfname:infname),
+		   UUFNameFilter ((outfname)?outfname:infname), 
 		   eolstring);
 	}
       }
@@ -1431,7 +1431,7 @@ UUEncodeToFile (FILE *infile, char *infname, int encoding,
       if (res != UURET_CANCEL) {
 	UUMessage (uuencode_id, __LINE__, UUMSG_ERROR,
 		   uustring (S_ERR_ENCODING),
-		   UUFNameFilter ((infname)?infname:outfname),
+		   UUFNameFilter ((infname)?infname:outfname),	 
 		   (res==UURET_IOERR)?strerror(uu_errno):UUstrerror (res));
       }
       if (infile==NULL) fclose (theifile);
@@ -1444,25 +1444,25 @@ UUEncodeToFile (FILE *infile, char *infname, int encoding,
 
     if (feof (theifile) &&
 	(encoding == UU_ENCODED || encoding == XX_ENCODED)) {
-      fprintf (outfile, "%c%s",
-	       (encoding==UU_ENCODED) ? UUEncodeTable[0] : XXEncodeTable[0],
+      fprintf (outfile, "%c%s",    
+	       (encoding==UU_ENCODED) ? UUEncodeTable[0] : XXEncodeTable[0], 
 	       eolstring);
       fprintf (outfile, "end%s", eolstring);
     }
     else if (encoding == YENC_ENCODED) {
       if (numparts != 1) {
-	fprintf (outfile, "=yend size=%ld part=%ld pcrc32=%08lx",
-		 (part*linperfile*128) < progress.totsize ?
+	fprintf (outfile, "=yend size=%d part=%d pcrc32=%08lx",
+		 (part*linperfile*128) < progress.totsize ? 
 		 linperfile*128 : (progress.totsize-(part-1)*linperfile*128),
 		 part,
 		 pcrc);
       }
       else {
-	fprintf (outfile, "=yend size=%ld",
+	fprintf (outfile, "=yend size=%d",
 		 progress.totsize);
       }
       if (feof (theifile))
-	fprintf (outfile, " crc32=%08lx", crc);
+	fprintf (outfile, " crc32=%08lx", crc); 
       fprintf (outfile, "%s", eolstring);
     }
 
@@ -1522,8 +1522,6 @@ UUE_PrepSingleExt (FILE *outfile, FILE *infile,
     return UURET_ILLVAL;
   }
 
-  if (!outfile) return UURET_IOERR;
-
   oname = UUFNameFilter ((outfname)?outfname:infname);
   len   = ((subject)?strlen(subject):0) + strlen(oname) + 40;
 
@@ -1547,9 +1545,9 @@ UUE_PrepSingleExt (FILE *outfile, FILE *infile,
 
   if (encoding == YENC_ENCODED) {
     if (subject)
-      sprintf (subline, "%s - \"%s\" (001/001)", subject, oname);
+      sprintf (subline, "- %s - %s (001/001)", oname, subject);
     else
-      sprintf (subline, "\"%s\" - (001/001)", oname);
+      sprintf (subline, "- %s - (001/001)", oname);
   }
   else {
     if (subject)
@@ -1587,7 +1585,7 @@ UUE_PrepSingleExt (FILE *outfile, FILE *infile,
 
   res = UUEncodeToStream (outfile, infile, infname, encoding,
 			  outfname, filemode);
-
+  
   _FP_free (subline);
   return res;
 }
@@ -1597,14 +1595,16 @@ UUE_PrepPartial (FILE *outfile, FILE *infile,
 		 char *infname, int encoding,
 		 char *outfname, int filemode,
 		 int partno, long linperfile, long filesize,
-		 char *destination, char *from, char *subject, int isemail)
+		 char *destination, char *from, char *subject,
+		 int isemail)
 {
   return UUE_PrepPartialExt (outfile, infile,
 			     infname, encoding,
 			     outfname, filemode,
 			     partno, linperfile, filesize,
 			     destination,
-			     from, subject, NULL, isemail);
+			     from, subject, NULL,
+			     isemail);
 }
 
 int UUEXPORT
@@ -1634,8 +1634,6 @@ UUE_PrepPartialExt (FILE *outfile, FILE *infile,
     return UURET_ILLVAL;
   }
 
-  if (!outfile) return UURET_IOERR;
-
   oname = UUFNameFilter ((outfname)?outfname:infname);
   len   = ((subject)?strlen(subject):0) + strlen (oname) + 40;
 
@@ -1659,7 +1657,7 @@ UUE_PrepPartialExt (FILE *outfile, FILE *infile,
       }
       if (linperfile <= 0)
 	numparts = 1;
-      else
+      else 
 	numparts = (int) (((long)finfo.st_size+(linperfile*bpl[encoding]-1))/
 			  (linperfile*bpl[encoding]));
 
@@ -1668,9 +1666,6 @@ UUE_PrepPartialExt (FILE *outfile, FILE *infile,
     }
     else {
       if (fstat (fileno (infile), &finfo) != 0) {
-
-	printf("debug: %lu %lu\n",((long)finfo.st_size+(linperfile*bpl[encoding]-1)), linperfile*bpl[encoding]);
-
 	if (filesize <= 0) {
 	  UUMessage (uuencode_id, __LINE__, UUMSG_WARNING,
 		     uustring (S_STAT_ONE_PART));
@@ -1730,17 +1725,20 @@ UUE_PrepPartialExt (FILE *outfile, FILE *infile,
   }
 
 
-  // [subject] - "filename" (partnum/numparts) yEnc
   if (encoding == YENC_ENCODED) {
     if (partno == 1)
       crc = crc32(0L, Z_NULL, 0);
-      crcptr = &crc;
-      sprintf (subline, "\"%s\" - (%03d/%03d)", oname,
+    crcptr = &crc;
+    if (subject)
+      sprintf (subline, "- %s - %s (%03d/%03d)", oname, subject,
+	       partno, numparts);
+    else
+      sprintf (subline, "- %s - (%03d/%03d)", oname,
 	       partno, numparts);
   }
   else {
     if (subject)
-      sprintf (subline, "%s (%03d/%03d) - [ %s ]",
+      sprintf (subline, "%s (%03d/%03d) - [ %s ]", 
 	       subject, partno, numparts, oname);
     else
       sprintf (subline, "[ %s ] (%03d/%03d)",
@@ -1770,7 +1768,7 @@ UUE_PrepPartialExt (FILE *outfile, FILE *infile,
     fprintf (outfile, "\tid=\"%s\"%s",
 	     mimeid, eolstring);
   }
-
+    
   fprintf (outfile, "%s", eolstring);
 
   res = UUEncodePartial (outfile, theifile,
diff --git a/uulib/uulib.c b/uulib/uulib.c
index 2d6816d..de8add7 100644
--- a/uulib/uulib.c
+++ b/uulib/uulib.c
@@ -84,7 +84,7 @@
 char * uulib_id = "$Id$";
 
 #ifdef SYSTEM_WINDLL
-BOOL _export WINAPI
+BOOL _export WINAPI 
 DllEntryPoint (HINSTANCE hInstance, DWORD seginfo,
 	       LPVOID lpCmdLine)
 {
@@ -574,7 +574,7 @@ UUstrerror (int code)
  */
 
 int UUEXPORT
-UUSetMsgCallback (void *opaque,
+UUSetMsgCallback (void *opaque, 
 		  void (*func) _ANSI_ARGS_((void *, char *, int)))
 {
   uu_MsgCallback = func;
@@ -719,7 +719,7 @@ UULoadFileWithPartNo (char *filename, char *fileid, int delflag, int partno)
     fileid = filename;
 
   while (!feof (datei) && !ferror (datei)) {
-    /*
+    /* 
      * Peek file, or some systems won't detect EOF
      */
     res = fgetc (datei);
@@ -727,7 +727,7 @@ UULoadFileWithPartNo (char *filename, char *fileid, int delflag, int partno)
       break;
     else
       ungetc (res, datei);
-
+    
     if ((loaded = ScanPart (datei, fileid, &sr)) == NULL) {
       if (sr != UURET_NODATA && sr != UURET_OK && sr != UURET_CONT) {
 	UUkillfread (loaded);
@@ -778,7 +778,7 @@ UULoadFileWithPartNo (char *filename, char *fileid, int delflag, int partno)
       if (uu_fast_scanning && sr != UURET_CONT) break;
       continue;
     }
-
+    
     if ((fload = UUPreProcessPart (loaded, &res)) == NULL) {
       /*
        * no useful data found
@@ -808,7 +808,7 @@ UULoadFileWithPartNo (char *filename, char *fileid, int delflag, int partno)
 		 (loaded->end)      ? "end"   : "",
 		 codenames[loaded->uudet]);
     }
-
+    
     if ((res = UUInsertPartToList (fload))) {
       /*
        * couldn't use the data
@@ -915,7 +915,7 @@ UUDecodeFile (uulist *thefile, char *destname)
 
   /*
    * Determine the name of the target file according to the rules:
-   *
+   * 
    * IF (destname!=NULL) THEN filename=destname;
    * ELSE
    *   filename = thefile->filename
@@ -1068,7 +1068,7 @@ UUInfoFile (uulist *thefile, void *opaque,
    */
 
   if (uu_FileCallback) {
-    if ((res = (*uu_FileCallback) (uu_FileCBArg,
+    if ((res = (*uu_FileCallback) (uu_FileCBArg, 
 				   thefile->thisfile->data->sfname,
 				   uugen_fnbuffer,
 				   1)) != UURET_OK)
@@ -1085,7 +1085,7 @@ UUInfoFile (uulist *thefile, void *opaque,
   else {
     if ((inpfile = fopen (thefile->thisfile->data->sfname, "rb")) == NULL) {
       UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
-		 uustring (S_NOT_OPEN_FILE),
+		 uustring (S_NOT_OPEN_FILE), 
 		 thefile->thisfile->data->sfname,
 		 strerror (uu_errno=errno));
       return UURET_IOERR;
@@ -1100,7 +1100,7 @@ UUInfoFile (uulist *thefile, void *opaque,
   fseek (inpfile, thefile->thisfile->data->startpos, SEEK_SET);
   maxpos = thefile->thisfile->data->startpos + thefile->thisfile->data->length;
 
-  while (!feof (inpfile) &&
+  while (!feof (inpfile) && 
 	 (uu_fast_scanning || ftell(inpfile) < maxpos)) {
     if (_FP_fgets (uugen_inbuffer, 511, inpfile) == NULL)
       break;
@@ -1136,7 +1136,7 @@ UUInfoFile (uulist *thefile, void *opaque,
   fclose (inpfile);
 
   if (uu_FileCallback)
-    (*uu_FileCallback) (uu_FileCBArg,
+    (*uu_FileCallback) (uu_FileCBArg, 
 			thefile->thisfile->data->sfname,
 			uugen_fnbuffer, 0);
 
@@ -1145,7 +1145,7 @@ UUInfoFile (uulist *thefile, void *opaque,
 
   return UURET_OK;
 }
-
+	    
 int UUEXPORT
 UURenameFile (uulist *thefile, char *newname)
 {



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