From: Pierre Habouzit Date: Sun, 29 Oct 2006 01:42:08 +0000 (+0100) Subject: we don't use strdup in mutt sources anymore, remove that compat file X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=9114fccb27d817ba18918a84524e6e8b1998f361 we don't use strdup in mutt sources anymore, remove that compat file --- diff --git a/configure.in b/configure.in index ed0ea67..2fad06b 100644 --- a/configure.in +++ b/configure.in @@ -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) diff --git a/makedoc.c b/makedoc.c index 29fa8f8..f5e85cf 100644 --- 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 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 -#include - -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; -}