[Define to 1 if you have the `sigsetjmp'.]) AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
-AC_REPLACE_FUNCS(memmove snprintf strerror strdup)
+AC_REPLACE_FUNCS(snprintf strdup)
dnl Look for the initgroups() declaration. On AIX 4.[13], Solaris 4.1.3, and
dnl ULTRIX 4.2A the function is defined in libc but there's no declaration in
char *m_note;
};
-#define adrformat(m) auxformat ((m), 1)
/*
* prototypes
void mnfree(struct mailname *);
int ismymbox(struct mailname *);
char *getname(char *);
-char *adrsprintf(char *, char *);
-char *auxformat(struct mailname *, int);
+char *adrformat(struct mailname *);
struct mailname *getm(char *, char *, int, int, char *);
/*
* prototypes
*/
-int isfrom(char *);
-int lequal (unsigned char *, unsigned char *);
-int mfgets (FILE *, char **);
char *legal_person (char *);
-struct adrx *seekadrx (char *);
struct adrx *getadrx (char *);
-struct adrx *uucpadrx (char *);
int atooi(char *);
char **brkstring (char *, char *, char *);
int check_charset (char *, int);
-int client(char *, char *, char *, int, int);
void closefds(int);
char *concat (char *, ...);
int context_del (char *);
char *m_mailpath (char *);
char *m_name (int);
int m_putenv (char *, char *);
-char *m_scratch (char *, char *);
-char *m_tmpfil (char *);
char *m_mktemp(const char *, int *, FILE **);
char *m_mktemp2(const char *, const char *, int *, FILE **);
void m_unknown(FILE *);
void readconfig (struct node **, FILE *, char *, int);
int refile (char **, char *);
void ruserpass(char *, char **, char **);
-int remdir (char *);
int seq_addmsg (struct msgs *, char *, int, int, int);
int seq_addsel (struct msgs *, char *, int, int);
char *seq_bits (struct msgs *);
# source for library functions
SRCS = addrsbr.c ambigsw.c atooi.c brkstring.c \
- check_charset.c client.c closefds.c concat.c context_del.c \
+ check_charset.c closefds.c concat.c context_del.c \
context_find.c context_foil.c context_read.c \
context_replace.c context_save.c copy.c \
copyip.c cpydata.c cpydgst.c crawl_folders.c \
fmt_addr.c fmt_compile.c fmt_new.c fmt_rfc2047.c \
fmt_scan.c lock_file.c m_atoi.c m_backup.c \
m_convert.c m_draft.c m_getfld.c m_gmprot.c \
- m_maildir.c m_name.c m_scratch.c m_tmpfil.c \
+ m_maildir.c m_name.c \
makedir.c mts.c norm_charmap.c \
path.c peekc.c pidwait.c pidstatus.c \
print_help.c print_sw.c print_version.c push.c \
- putenv.c refile.c remdir.c r1bindex.c \
+ putenv.c refile.c r1bindex.c \
readconfig.c ruserpass.c seq_add.c seq_bits.c \
seq_del.c seq_getnum.c seq_list.c seq_nameok.c \
seq_print.c seq_read.c seq_save.c seq_setcur.c \
m_msgdef.c mf.c utils.c m_mktemp.c
# source for compatibility functions
-COMPAT = memmove.c snprintf.c strdup.c strerror.c
+COMPAT = snprintf.c strdup.c
OBJS = $(SRCS:.c=.o) $(LIBOBJS)
dtimep.c: dtimep.lex
$(LEX) -n -t $(srcdir)/dtimep.lex > dtimep.c
-client.o: client.c
- $(COMPILE2) $(srcdir)/client.c
-
mts.o: mts.c
$(COMPILE2) $(srcdir)/mts.c
#define empty(s) ((s) ? (s) : "")
char *
-auxformat (struct mailname *mp, int extras)
+adrformat (struct mailname *mp)
{
static char addr[BUFSIZ];
static char buffer[BUFSIZ];
#endif /* not BANG */
snprintf (addr, sizeof(addr), "%s!%s", mp->m_host, mp->m_mbox);
- if (!extras)
- return addr;
-
if (mp->m_pers || mp->m_path) {
if (mp->m_note)
snprintf (buffer, sizeof(buffer), "%s %s <%s>",
}
-/*
- * address specific "sprintf"
- */
-
-char *
-adrsprintf (char *username, char *domain)
-{
- int snprintf_return;
- static char addr[BUFSIZ];
-
- if (username == NULL)
- username = getusername();
-
- if (username_extension_masquerading) {
- /* mts.conf contains "masquerade:[...]username_extension[...]",
- * so tack on the value of the $USERNAME_EXTENSION environment
- * variable, if set, to username.
- */
- char* extension = getenv("USERNAME_EXTENSION");
- static char username_with_extension[BUFSIZ];
-
- if (extension != NULL && *extension != '\0') {
- snprintf_return = snprintf(username_with_extension,
- sizeof(username_with_extension),
- "%s%s", username, extension);
-
- if (snprintf_return < 0 ||
- snprintf_return >= sizeof(username_with_extension))
- adios(NULL, "snprintf() error writing username (%d chars) and"
- " $USERNAME_EXTENSION (%d chars) to array of BUFSIZ (%d)"
- " chars",
- strlen(username), strlen(extension), BUFSIZ);
-
- username = username_with_extension;
- }
- }
-
-#ifdef REALLYDUMB
- return username;
-#endif
-
- if (domain == NULL)
- domain = LocalName();
-
-#ifndef BANG
- snprintf_return = snprintf (addr, sizeof(addr), "%s@%s", username, domain);
-#else /* BANG */
- snprintf_return = snprintf (addr, sizeof(addr), "%s!%s", domain, username);
-#endif /* BANG */
-
- if (snprintf_return < 0 || snprintf_return >= sizeof(addr))
- adios(NULL, "snprintf() error writing username (%d chars), domain (%d"
- " chars), and 1 separator char to array of BUFSIZ (%d) chars",
- strlen(username), strlen(domain), BUFSIZ);
-
- return addr;
-}
-
-
#define W_NIL 0x0000
#define W_MBEG 0x0001
#define W_MEND 0x0002
+++ /dev/null
-/*
- * client.c -- connect to a server
- *
- * This code is Copyright (c) 2002, by the authors of nmh. See the
- * COPYRIGHT file in the root directory of the nmh distribution for
- * complete copyright information.
- */
-
-#include <h/mh.h>
-#include <h/mts.h>
-#include <h/utils.h>
-#include <errno.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-
-#define TRUE 1
-#define FALSE 0
-
-#define MAXARGS 1000
-
-/*
- * static prototypes
- */
-
-/* client's own static version of several nmh subroutines */
-static char **client_brkstring (char *, char *, char *);
-static int client_brkany (char, char *);
-static char **client_copyip (char **, char **, int);
-static char *client_getcpy (char *);
-static void client_freelist(char **);
-
-
-int
-client (char *args, char *service, char *response, int len_response, int debug)
-{
- int sd, rc;
- char **ap, *arguments[MAXARGS];
- struct addrinfo hints, *res, *ai;
-
- ap = arguments;
- if (args != NULL && *args != 0) {
- ap = client_copyip (client_brkstring (client_getcpy (args), " ", "\n"),
- ap, MAXARGS);
- }
- if (ap == arguments) {
- *ap++ = client_getcpy ("localhost");
- *ap = NULL;
- }
-
- memset(&hints, 0, sizeof(hints));
-#ifdef AI_ADDRCONFIG
- hints.ai_flags = AI_ADDRCONFIG;
-#endif
- hints.ai_family = PF_UNSPEC;
- hints.ai_socktype = SOCK_STREAM;
-
- for (ap = arguments; *ap; ap++) {
-
- if (debug) {
- fprintf(stderr, "Trying to connect to \"%s\" ...\n", *ap);
- }
-
- rc = getaddrinfo(*ap, service, &hints, &res);
-
- if (rc) {
- if (debug) {
- fprintf(stderr, "Lookup of \"%s\" failed: %s\n", *ap,
- gai_strerror(rc));
- }
- continue;
- }
-
- for (ai = res; ai != NULL; ai = ai->ai_next) {
- if (debug) {
- char address[NI_MAXHOST];
-
- rc = getnameinfo(ai->ai_addr, ai->ai_addrlen, address,
- sizeof(address), NULL, 0, NI_NUMERICHOST);
-
- fprintf(stderr, "Connecting to %s...\n",
- rc ? "unknown" : address);
- }
-
- sd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
-
- if (sd < 0) {
- if (debug)
- fprintf(stderr, "socket() failed: %s\n", strerror(errno));
- continue;
- }
-
- if (connect(sd, ai->ai_addr, ai->ai_addrlen) == 0) {
- freeaddrinfo(res);
- client_freelist(ap);
- return sd;
- }
-
- if (debug) {
- fprintf(stderr, "Connection failed: %s\n", strerror(errno));
- }
-
- close(sd);
- }
-
- freeaddrinfo(res);
- }
-
- client_freelist(ap);
- strncpy (response, "no servers available", len_response);
- return NOTOK;
-}
-
-
-/*
- * Free a list of strings
- */
-
-static void
-client_freelist(char **list)
-{
- while (*list++ != NULL)
- free(*list);
-}
-
-
-/*
- * static copies of three nmh subroutines
- */
-
-static char *broken[MAXARGS + 1];
-
-static char **
-client_brkstring (char *strg, char *brksep, char *brkterm)
-{
- register int bi;
- register char c, *sp;
-
- sp = strg;
-
- for (bi = 0; bi < MAXARGS; bi++) {
- while (client_brkany (c = *sp, brksep))
- *sp++ = 0;
- if (!c || client_brkany (c, brkterm)) {
- *sp = 0;
- broken[bi] = 0;
- return broken;
- }
-
- broken[bi] = sp;
- while ((c = *++sp) && !client_brkany (c, brksep) && !client_brkany (c, brkterm))
- continue;
- }
- broken[MAXARGS] = 0;
-
- return broken;
-}
-
-
-/*
- * returns 1 if chr in strg, 0 otherwise
- */
-static int
-client_brkany (char chr, char *strg)
-{
- register char *sp;
-
- if (strg)
- for (sp = strg; *sp; sp++)
- if (chr == *sp)
- return 1;
- return 0;
-}
-
-
-/*
- * copy a string array and return pointer to end
- */
-static char **
-client_copyip (char **p, char **q, int len_q)
-{
- while (*p && --len_q > 0)
- *q++ = *p++;
-
- *q = NULL;
-
- return q;
-}
-
-
-static char *
-client_getcpy (char *str)
-{
- char *cp;
- size_t len;
-
- len = strlen(str) + 1;
- cp = mh_xmalloc(len);
-
- memcpy (cp, str, len);
- return cp;
-}
-
* name of the hook to use, the second is the full path name of a mail message.
* The third argument is also the full path name of a mail message, or a NULL
* pointer if it isn't needed. Look in the context for an error message if
- * something goes wrong; there is a built-in message in case one isn't specified.
- * Only produce the error message once.
+ * something goes wrong; there is a built-in message in case one isn't
+ * specified. Only produce the error message once.
*/
#include <h/mh.h>
}
return (NOTOK);
- }
-
- else
+ } else
return (OK);
}
return encoding_found;
buffull:
- /* q is currently just off the end of the buffer, so rewind to NUL terminate */
+ /* q is currently just off the end of the buffer,
+ * so rewind to NUL terminate */
q--;
*q = '\0';
return encoding_found;
return (cnt > 0 ? --src : (unsigned char *)0);
}
-
+++ /dev/null
-/*
- * m_scratch.c -- construct a scratch file
- *
- * This code is Copyright (c) 2002, by the authors of nmh. See the
- * COPYRIGHT file in the root directory of the nmh distribution for
- * complete copyright information.
- */
-
-#include <h/mh.h>
-
-/***************************************************************************
- * DO NOT USE THIS FUNCTION! IT WILL BE REMOVED IN THE FUTURE.
- * THIS FUNCTION IS INSECURE. USE THE FUNCTIONS DEFINED IN m_mktemp.c.
- ***************************************************************************/
-char *
-m_scratch (char *file, char *template)
-{
- char *cp;
- static char buffer[BUFSIZ], tmpfil[BUFSIZ];
-
- snprintf (tmpfil, sizeof(tmpfil), "%sXXXXXX", template);
-/*
- * Mkstemp work postponed until later -Doug
- * #ifdef HAVE_MKSTEMP
- * mkstemp (tmpfil);
- * #else
- */
- mktemp (tmpfil);
-/*
- * #endif
- */
- /* nasty - this really means: if there is no '/' in the path */
- if ((cp = r1bindex (file, '/')) == file)
- strncpy (buffer, tmpfil, sizeof(buffer));
- else
- snprintf (buffer, sizeof(buffer), "%.*s%s", (int)(cp - file), file, tmpfil);
- unlink (buffer);
-
- return buffer;
-}
+++ /dev/null
-/*
- * m_tmpfil.c -- construct a temporary file
- *
- * This code is Copyright (c) 2002, by the authors of nmh. See the
- * COPYRIGHT file in the root directory of the nmh distribution for
- * complete copyright information.
- */
-
-#include <h/mh.h>
-
-/***************************************************************************
- * DO NOT USE THIS FUNCTION! IT WILL BE REMOVED IN THE FUTURE.
- * THIS FUNCTION IS INSECURE. USE THE FUNCTIONS DEFINED IN m_mktemp.c.
- ***************************************************************************/
-char *
-m_tmpfil (char *template)
-{
- static char tmpfil[BUFSIZ];
-
- snprintf (tmpfil, sizeof(tmpfil), "/tmp/%sXXXXXX", template);
-/*
- * Mkstemp work postponed until later -Doug
- * #ifdef HAVE_MKSTEMP
- * unlink(mkstemp(tmpfil));
- * #else
- */
- unlink(mktemp(tmpfil));
-/*
- * #endif
- */
- return tmpfil;
-}
+++ /dev/null
-/* public domain function from Jan Wolter Unix Incompatibility Notes */
-/* http://unixpapa.com/incnote/ */
-char *
-memmove(char *dst, char *src, int n)
-{
- if (src > dst)
- for ( ; n > 0; n--)
- *(dst++)= *(src++);
- else
- for (dst+= n-1, src+= n-1; n > 0; n--)
- *(dst--)= *(src--);
-}
* static prototypes
*/
static char *getcpy (char *);
-static void compress (char *, unsigned char *);
static int isat (char *);
static int parse_address (void);
static int phrase (char *);
register char *p;
if (!s) {
-/* causes compiles to blow up because the symbol _cleanup is undefined
- * where did this ever come from? */
+ /*
+ * causes compiles to blow up because the symbol _cleanup
+ * is undefined where did this ever come from?
+ */
/* _cleanup(); */
abort();
for(;;)
}
-int
-isfrom(char *string)
-{
- return (strncmp (string, "From ", 5) == 0
- || strncmp (string, ">From ", 6) == 0);
-}
-
-
-int
-lequal (unsigned char *a, unsigned char *b)
-{
- for (; *a; a++, b++)
- if (*b == 0)
- return FALSE;
- else {
- char c1 = islower (*a) ? toupper (*a) : *a;
- char c2 = islower (*b) ? toupper (*b) : *b;
- if (c1 != c2)
- return FALSE;
- }
-
- return (*b == 0);
-}
-
-
-/*
- * seekadrx() is tricky. We want to cover both UUCP-style and ARPA-style
- * addresses, so for each list of addresses we see if we can find some
- * character to give us a hint.
- */
-
-
#define CHKADR 0 /* undertermined address style */
#define UNIXDR 1 /* UNIX-style address */
#define ARPADR 2 /* ARPAnet-style address */
-static char *punctuators = ";<>.()[]";
-static char *vp = NULL;
-static char *tp = NULL;
-
-static struct adrx adrxs1;
-
-
-struct adrx *
-seekadrx (char *addrs)
-{
- static int state = CHKADR;
- register char *cp;
- register struct adrx *adrxp;
-
- if (state == CHKADR)
- for (state = UNIXDR, cp = addrs; *cp; cp++)
- if (strchr(punctuators, *cp)) {
- state = ARPADR;
- break;
- }
-
- switch (state) {
- case UNIXDR:
- adrxp = uucpadrx (addrs);
- break;
-
- case ARPADR:
- default:
- adrxp = getadrx (addrs);
- break;
- }
-
- if (adrxp == NULL)
- state = CHKADR;
-
- return adrxp;
-}
-
-
-/*
- * uucpadrx() implements a partial UUCP-style address parser. It's based
- * on the UUCP notion that addresses are separated by spaces or commas.
- */
-
-
-struct adrx *
-uucpadrx (char *addrs)
-{
- register unsigned char *cp, *wp, *xp, *yp;
- register char *zp;
- register struct adrx *adrxp = &adrxs1;
-
- if (vp == NULL) {
- vp = tp = getcpy (addrs);
- compress (addrs, vp);
- } else if (tp == NULL) {
- free (vp);
- vp = NULL;
- return NULL;
- }
-
- for (cp = tp; isspace (*cp); cp++)
- continue;
- if (*cp == 0) {
- free (vp);
- vp = tp = NULL;
- return NULL;
- }
-
- if ((wp = strchr(cp, ',')) == NULL) {
- if ((wp = strchr(cp, ' ')) != NULL) {
- xp = wp;
- while (isspace (*xp))
- xp++;
- if (*xp != 0 && isat (--xp)) {
- yp = xp + 4;
- while (isspace (*yp))
- yp++;
- if (*yp != 0) {
- if ((zp = strchr(yp, ' ')) != NULL)
- *zp = 0, tp = ++zp;
- else
- tp = NULL;
- } else
- *wp = 0, tp = ++wp;
- } else
- *wp = 0, tp = ++wp;
- } else
- tp = NULL;
- } else
- *wp = 0, tp = ++wp;
-
- if (adrxp->text)
- free (adrxp->text);
- adrxp->text = getcpy (cp);
- adrxp->mbox = cp;
- adrxp->host = adrxp->path = NULL;
- if ((wp = strrchr(cp, '@')) != NULL) {
- *wp++ = 0;
- adrxp->host = *wp ? wp : NULL;
- } else
- for (wp = cp + strlen (cp) - 4; wp >= cp; wp--)
- if (isat (wp)) {
- *wp++ = 0;
- adrxp->host = wp + 3;
- }
-
- adrxp->pers = adrxp->grp = adrxp->note = adrxp->err = NULL;
- adrxp->ingrp = 0;
-
- return adrxp;
-}
-
-
-static void
-compress (char *fp, unsigned char *tp)
-{
- register char c;
- register unsigned char *cp;
-
- for (c = ' ', cp = tp; (*tp = *fp++) != 0;)
- if (isspace (*tp)) {
- if (c != ' ')
- *tp++ = c = ' ';
- } else
- c = *tp++;
-
- if (c == ' ' && cp < tp)
- *--tp = 0;
-}
-
-
static int
isat (char *p)
{
register unsigned char c;
register char *bp;
-/* Add C to the buffer bp. After use of this macro *bp is guaranteed to be within the buffer. */
-#define ADDCHR(C) do { *bp++ = (C); if ((bp - buffer) == (BUFSIZ-1)) goto my_lex_buffull; } while (0)
+ /*
+ * Add C to the buffer bp. After use of this macro *bp is guaranteed
+ * to be within the buffer.
+ */
+#define ADDCHR(C) \
+ do { \
+ *bp++ = (C); \
+ if ((bp - buffer) == (BUFSIZ-1)) \
+ goto my_lex_buffull; \
+ } while (0)
bp = buffer;
*bp = 0;
return p;
}
-
-
-int
-mfgets (FILE *in, char **bp)
-{
- int i;
- register char *cp, *dp, *ep;
- static int len = 0;
- static char *pp = NULL;
-
- if (pp == NULL)
- pp = mh_xmalloc ((size_t) (len = BUFSIZ));
-
- for (ep = (cp = pp) + len - 2;;) {
- switch (i = getc (in)) {
- case EOF:
- eol: ;
- if (cp != pp) {
- *cp = 0;
- *bp = pp;
- return OK;
- }
- eoh: ;
- *bp = NULL;
- free (pp);
- pp = NULL;
- return DONE;
-
- case 0:
- continue;
-
- case '\n':
- if (cp == pp) /* end of headers, gobble it */
- goto eoh;
- switch (i = getc (in)) {
- default: /* end of line */
- case '\n': /* end of headers, save for next call */
- ungetc (i, in);
- goto eol;
-
- case ' ': /* continue headers */
- case '\t':
- *cp++ = '\n';
- break;
- } /* fall into default case */
-
- default:
- *cp++ = i;
- break;
- }
- if (cp >= ep) {
- dp = mh_xrealloc (pp, (size_t) (len += BUFSIZ));
- cp += dp - pp, ep = (pp = cp) + len - 2;
- }
- }
-}
+++ /dev/null
-/*
- * remdir.c -- remove a directory
- *
- * This code is Copyright (c) 2002, by the authors of nmh. See the
- * COPYRIGHT file in the root directory of the nmh distribution for
- * complete copyright information.
- */
-
-#include <h/mh.h>
-
-
-int
-remdir (char *dir)
-{
- context_save(); /* save the context file */
- fflush(stdout);
-
- if (rmdir(dir) == -1) {
- admonish (dir, "unable to remove directory");
- return 0;
- }
- return 1;
-}
#define NDIG 80
/* buf must have at least NDIG bytes */
-static char *ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag, char *buf)
+static char *
+ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag, char *buf)
{
register int r2;
double fi, fj;
return (buf);
}
-static char *ap_ecvt(double arg, int ndigits, int *decpt, int *sign, char *buf)
+static char *
+ap_ecvt(double arg, int ndigits, int *decpt, int *sign, char *buf)
{
return (ap_cvt(arg, ndigits, decpt, sign, 1, buf));
}
-static char *ap_fcvt(double arg, int ndigits, int *decpt, int *sign, char *buf)
+static char *
+ap_fcvt(double arg, int ndigits, int *decpt, int *sign, char *buf)
{
return (ap_cvt(arg, ndigits, decpt, sign, 0, buf));
}
* minimal length string
*/
-static char *ap_gcvt(double number, int ndigit, char *buf, boolean_e altform)
+static char *
+ap_gcvt(double number, int ndigit, char *buf, boolean_e altform)
{
int sign, decpt;
register char *p1, *p2;
* which is a pointer to the END of the buffer + 1 (i.e. if the buffer
* is declared as buf[ 100 ], buf_end should be &buf[ 100 ])
*/
-static char *conv_10(register wide_int num, register bool_int is_unsigned,
+static char *
+conv_10(register wide_int num, register bool_int is_unsigned,
register bool_int *is_negative, char *buf_end,
register int *len)
{
-static char *conv_in_addr(struct in_addr *ia, char *buf_end, int *len)
+static char *
+conv_in_addr(struct in_addr *ia, char *buf_end, int *len)
{
unsigned addr = ntohl(ia->s_addr);
char *p = buf_end;
-static char *conv_sockaddr_in(struct sockaddr_in *si, char *buf_end, int *len)
+static char *
+conv_sockaddr_in(struct sockaddr_in *si, char *buf_end, int *len)
{
char *p = buf_end;
bool_int is_negative;
* The sign is returned in the is_negative argument (and is not placed
* in buf).
*/
-static char *conv_fp(register char format, register double num,
+static char *
+conv_fp(register char format, register double num,
boolean_e add_dp, int precision, bool_int *is_negative,
char *buf, int *len)
{
* which is a pointer to the END of the buffer + 1 (i.e. if the buffer
* is declared as buf[ 100 ], buf_end should be &buf[ 100 ])
*/
-static char *conv_p2(register u_wide_int num, register int nbits,
+static char *
+conv_p2(register u_wide_int num, register int nbits,
char format, char *buf_end, register int *len)
{
register int mask = (1 << nbits) - 1;
/*
* Do format conversion placing the output in buffer
*/
-int ap_vformatter(int (*flush_func)(ap_vformatter_buff *),
+static int
+ap_vformatter(int (*flush_func)(ap_vformatter_buff *),
ap_vformatter_buff *vbuff, const char *fmt, va_list ap)
{
register char *sp;
}
-static int snprintf_flush(ap_vformatter_buff *vbuff)
+static int
+snprintf_flush(ap_vformatter_buff *vbuff)
{
/* if the buffer fills we have to abort immediately, there is no way
* to "flush" a snprintf... there's nowhere to flush it to.
}
-int snprintf(char *buf, size_t len, const char *format,...)
+int
+snprintf(char *buf, size_t len, const char *format,...)
{
int cc;
va_list ap;
}
-int vsnprintf(char *buf, size_t len, const char *format, va_list ap)
+int
+vsnprintf(char *buf, size_t len, const char *format, va_list ap)
{
int cc;
ap_vformatter_buff vbuff;
return (0);
return (tolower(*us1) - tolower(*--us2));
}
-
-
-int
-mh_strncasecmp (const char *s1, const char *s2, size_t n)
-{
- const unsigned char *us1, *us2;
-
- if (n != 0) {
- us1 = (const unsigned char *) s1,
- us2 = (const unsigned char *) s2;
-
- do {
- if (tolower(*us1) != tolower(*us2++))
- return (tolower(*us1) - tolower(*--us2));
- if (*us1++ == '\0')
- break;
- } while (--n != 0);
- }
- return (0);
-}
+++ /dev/null
-/*
- * strerror.c -- get error message string
- */
-
-#include <h/mh.h>
-
-extern int sys_nerr;
-extern char *sys_errlist[];
-
-
-char *
-strerror (int errnum)
-{
- if (errnum > 0 && errnum < sys_nerr)
- return sys_errlist[errnum];
- else
- return NULL;
-}
* folder_exists
* Check to see if a folder exists.
*/
-int folder_exists(char *folder)
+int
+folder_exists(char *folder)
{
struct stat st;
int exists = 0;
* create_folder
* Check to see if a folder exists, if not, prompt the user to create it.
*/
-void create_folder(char *folder, int autocreate, void (*done_callback)(int))
+void
+create_folder(char *folder, int autocreate, void (*done_callback)(int))
{
struct stat st;
extern int errno;
rma (folder);
chdir ("..");
- if (others == 0 && remdir (maildir))
- return OK;
+ if (others == 0) {
+ context_save(); /* Is this needed? meillo 2011-10 */
+ fflush(stdout); /* Is this needed? meillo 2011-10 */
+ if (rmdir(maildir) != -1) {
+ return OK;
+ }
+ admonish (maildir, "unable to remove directory");
+ }
advise (NULL, "folder +%s not removed", folder);
return NOTOK;