From: Olivier Fredj <olivier@fredj.org>
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Fri, 31 Mar 2006 20:24:18 +0000 (20:24 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Fri, 31 Mar 2006 20:24:18 +0000 (20:24 +0000)
Rocco Rutte:
- make our own str_dup() return copy of "" (=="\0") if called with "" (fixes at least one crash in f=f handler which assumes that a copy of "" returns !=NULL)

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

VERSION.svn
lib/str.c

index 0d1dc8d..34eafc3 100644 (file)
@@ -1 +1 @@
-796
+797
index f70bfda..26df4b2 100644 (file)
--- a/lib/str.c
+++ b/lib/str.c
@@ -21,8 +21,7 @@ char *str_dup (const char *s)
   char *p;
   size_t l;
 
-  if (!s || !*s)
-    return 0;
+  if (!s) return 0;
   l = str_len (s) + 1;
   p = (char *) mem_malloc (l);
   memcpy (p, s, l);