Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Mon, 3 Apr 2006 10:57:24 +0000 (10:57 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Mon, 3 Apr 2006 10:57:24 +0000 (10:57 +0000)
- back out last str_dup() change as it breaks IMAP logins (and likely more places where '!s' tests are done but not '!*s') (reported on IRC and by Trey Sizemore <trey@fastmail.fm>); for the f=f crash, fix f=f handler instead

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@798 e385b8ad-14ed-0310-8656-cc95a2468c6d

VERSION.svn
lib/str.c
rfc3676.c

index 34eafc3..8832c4d 100644 (file)
@@ -1 +1 @@
-797
+798
index 26df4b2..451b898 100644 (file)
--- a/lib/str.c
+++ b/lib/str.c
@@ -21,7 +21,7 @@ char *str_dup (const char *s)
   char *p;
   size_t l;
 
   char *p;
   size_t l;
 
-  if (!s) return 0;
+  if (!s || !*s) return NULL;
   l = str_len (s) + 1;
   p = (char *) mem_malloc (l);
   memcpy (p, s, l);
   l = str_len (s) + 1;
   p = (char *) mem_malloc (l);
   memcpy (p, s, l);
index b1a2e01..f6ca099 100644 (file)
--- a/rfc3676.c
+++ b/rfc3676.c
@@ -136,13 +136,15 @@ static void print_flowed_line (char *line, STATE * s, int ql) {
 int rfc3676_handler (BODY * a, STATE * s) {
   int bytes = a->length;
   char buf[LONG_STRING];
 int rfc3676_handler (BODY * a, STATE * s) {
   int bytes = a->length;
   char buf[LONG_STRING];
-  char *curline = str_dup ("");
+  char *curline = mem_malloc(1);
   char *t = NULL;
   unsigned int curline_len = 1,
                quotelevel = 0, newql = 0;
   int buf_off, buf_len;
   int delsp = 0, fixed = 0;
 
   char *t = NULL;
   unsigned int curline_len = 1,
                quotelevel = 0, newql = 0;
   int buf_off, buf_len;
   int delsp = 0, fixed = 0;
 
+  *curline='\0';
+
   /* respect DelSP of RfC3676 only with f=f parts */
   if ((t = (char*) mutt_get_parameter ("delsp", a->parameter))) {
     delsp = str_len (t) == 3 && ascii_strncasecmp (t, "yes", 3) == 0;
   /* respect DelSP of RfC3676 only with f=f parts */
   if ((t = (char*) mutt_get_parameter ("delsp", a->parameter))) {
     delsp = str_len (t) == 3 && ascii_strncasecmp (t, "yes", 3) == 0;