we don't use strdup in mutt sources anymore, remove that compat file
authorPierre Habouzit <madcoder@debian.org>
Sun, 29 Oct 2006 01:42:08 +0000 (02:42 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sun, 29 Oct 2006 01:42:08 +0000 (02:42 +0100)
configure.in
makedoc.c
strdup.c [deleted file]

index ed0ea67..2fad06b 100644 (file)
@@ -326,7 +326,7 @@ AC_TYPE_PID_T
 dnl AC_CHECK_TYPE(ssize_t, int)
 
 AC_CHECK_FUNCS(fgetpos memmove setegid srand48 strerror)
-AC_REPLACE_FUNCS(strcasecmp strdup setenv)
+AC_REPLACE_FUNCS(strcasecmp setenv)
 AC_CHECK_FUNCS(snprintf vsnprintf)
 
 AC_CHECK_FUNC(getopt)
index 29fa8f8..f5e85cf 100644 (file)
--- a/makedoc.c
+++ b/makedoc.c
@@ -191,7 +191,7 @@ static void add_var (const char *name)
 {
   outbuf = realloc (outbuf, (++outcount) * sizeof (var_t));
   outbuf[outcount - 1].seen = 0;
-  outbuf[outcount - 1].name = strdup (name);
+  outbuf[outcount - 1].name = p_strdup(name, str_len(name));
   outbuf[outcount - 1].descr = NULL;
 }
 
@@ -207,7 +207,7 @@ static int add_s (const char *s)
   }
 
   if (lold == 0)
-    outbuf[outcount - 1].descr = strdup (s);
+    outbuf[outcount - 1].descr = p_strdup(s, str_len(s));
   else {
     outbuf[outcount - 1].descr =
       realloc (outbuf[outcount - 1].descr, lold + lnew + 1);
diff --git a/strdup.c b/strdup.c
deleted file mode 100644 (file)
index 9920a4a..0000000
--- a/strdup.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright notice from original mutt:
- * [none]
- *
- * This file is part of mutt-ng, see http://www.muttng.org/.
- * It's licensed under the GNU General Public License,
- * please see the file GPL in the top level source directory.
- */
-
-/* ultrix doesn't have strdup */
-
-#include <string.h>
-#include <stdlib.h>
-
-char *strdup (const char *s)
-{                               /* __MEM_CHECKED__ */
-  char *d;
-
-  if (s == NULL)
-    return NULL;
-
-  if ((d = malloc (str_len (s) + 1)) == NULL)    /* __MEM_CHECKED__ */
-    return NULL;
-
-  memcpy (d, s, str_len (s) + 1);
-  return d;
-}