Commit 88009983 88009983722512ea36ce3112ffb0cf657ca18d67 by Sergey Poznyakoff

Minor change.

* configure.ac: Remove checks for strtok_r, strchrnul, strndup,
asprintf, vasprintf: none of these is used any more.
* maidag/lmtp.c (lmtp_reply): Use mu_vasnprintf.
* mh/mh.h (strchrnul): Remove proto.
* mh/mh_list.c (want_header): Rewrite.
(print): Use strcspn.
1 parent 38d688c1
......@@ -492,22 +492,13 @@ else
fi
AC_FUNC_MMAP
AC_CHECK_DECLS([strtok_r, strchrnul, strndup, asprintf, vasprintf, strsignal],
, , [
#include <stdio.h>
#include <string.h>
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif])
AC_CHECK_DECLS([strsignal])
AC_CHECK_DECLS(environ, , ,
[ #include <unistd.h>
#include <stdlib.h> ])
AH_BOTTOM([
#if !HAVE_DECL_STRTOK_R
extern char *strtok_r (char *s, const char *delim, char **save_ptr);
#endif
#if !HAVE_DECL_STRSIGNAL
extern char *strsignal (int);
#endif
......
......@@ -267,7 +267,7 @@ mu_streamref_create_abridged (mu_stream_t *pref, mu_stream_t str,
int flags;
struct _mu_streamref *sp;
rc = mu_stream_seek (str, 0, MU_SEEK_SET, &off);//FIXME: SEEK_CUR?
rc = mu_stream_seek (str, 0, MU_SEEK_SET, &off);/*FIXME: SEEK_CUR?*/
if (rc)
return rc;
mu_stream_get_flags (str, &flags);
......
......@@ -59,10 +59,11 @@ void
lmtp_reply (mu_stream_t iostr, char *code, char *enh, char *fmt, ...)
{
va_list ap;
char *str;
char *str = NULL;
size_t size = 0;
va_start (ap, fmt);
vasprintf (&str, fmt, ap);
mu_vasnprintf (&str, &size, fmt, ap);
va_end (ap);
if (!str)
......
......@@ -60,10 +60,6 @@
#include <mu_umaxtostr.h>
#if !HAVE_DECL_STRCHRNUL
extern char *strchrnul (const char *s, int c_in);
#endif
#define MH_FMT_RALIGN 0x1000
#define MH_FMT_ZEROPAD 0x2000
#define MH_FMT_COMPWS 0x4000
......
......@@ -937,7 +937,7 @@ mh_charset (const char *dfl)
/* Try to deduce the charset from LC_ALL variable */
struct mu_lc_all lc_all;
if (mu_parse_lc_all (getenv ("LC_ALL"), &lc_all, MU_LC_CSET) == 0)
saved_charset = lc_all.charset; /* FIXME: Memory leak */
saved_charset = lc_all.charset; /* FIXME: Mild memory leak */
}
charset = saved_charset;
}
......
......@@ -480,16 +480,24 @@ header_is_printed (struct eval_env *env, const char *name)
int
want_header (struct eval_env *env, const char *name)
{
char *p, *str = env->svar[S_IGNORES];
const char *p, *str;
for (p = strchrnul (str, ','); *str; p = strchrnul (str, ','))
for (str = env->svar[S_IGNORES], p = name; *str; str++)
{
if (mu_c_strncasecmp (name, str, p - str) == 0)
return 0;
str = p;
if (*str)
str++;
if (p)
{
if (*p == 0 && *str == ',')
break;
if (mu_tolower (*p) == mu_tolower (*str))
p++;
else
p = NULL;
}
else if (*str == ',')
p = name;
}
if (p && *p == 0)
return 0;
return 1;
}
......@@ -577,16 +585,15 @@ print (struct eval_env *env, char *str, int nloff)
newline (env);
str++;
}
else
else if (*str)
{
char *p = strchrnul (str, '\n');
ovf_print (env, str, p - str, nloff);
str = p;
if (*p)
size_t size = strcspn (str, "\n");
ovf_print (env, str, size, nloff);
str += size;
if (*str == '\n')
{
newline (env);
for (str++; *str && mu_isspace (*str); str++)
;
str = mu_str_skip_class (str + 1, MU_CTYPE_SPACE);
}
}
}
......