Get rid of more whitespace errors; hopefully I got them all.
if ($subtype eq 'alternative' && ! defined $altout &&
$type eq 'text/plain') {
- $altout = 1;
+ $altout = 1;
}
#
/* codes returned by alias() */
-#define AK_OK 0 /* file parsed OK */
-#define AK_NOFILE 1 /* couldn't read file */
-#define AK_ERROR 2 /* error parsing file */
+#define AK_OK 0 /* file parsed OK */
+#define AK_NOFILE 1 /* couldn't read file */
+#define AK_ERROR 2 /* error parsing file */
#define AK_LIMIT 3 /* memory limit exceeded */
#define DEFINE_SWITCH_ENUM(name) \
enum { \
- name ## _SWITCHES \
+ name ## _SWITCHES \
LEN_ ## name \
}
#define DEFINE_SWITCH_ARRAY(name, array) \
static struct swit array[] = { \
- name ## _SWITCHES \
+ name ## _SWITCHES \
{ NULL, 0, 0 } \
}
* See if file has any 8-bit bytes.
* Arguments include:
*
- * fd - file descriptor
+ * fd - file descriptor
* eightbit - address of result, will be set to 1 if the file contains
* any 8-bit bytes, 0 otherwise.
*
AS_IF([test "x$enableval" = xyes],[
AC_MSG_ERROR([--enable-lockdir requires an argument])])
AC_DEFINE_UNQUOTED([LOCKDIR], ["$enableval"],
- [Directory to store dot-locking lock files])
+ [Directory to store dot-locking lock files])
])])
[for tputs_arg1 in 'const char *' 'char *'; do
for tputs_putc_arg in 'int' 'char'; do
AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
+ [AC_LANG_PROGRAM(
[AC_INCLUDES_DEFAULT
#include <curses.h>
#include <term.h>
strncpy (addr, FENDNULL(mp->m_mbox), sizeof(addr));
else if (mp->m_type != UUCPHOST) {
if (mp->m_host)
- snprintf (addr, sizeof(addr), "%s%s@%s", FENDNULL(mp->m_path),
+ snprintf (addr, sizeof(addr), "%s%s@%s", FENDNULL(mp->m_path),
FENDNULL(mp->m_mbox), mp->m_host);
else snprintf (addr, sizeof(addr), "%s%s", FENDNULL(mp->m_path),
- FENDNULL(mp->m_mbox));
+ FENDNULL(mp->m_mbox));
} else
snprintf (addr, sizeof(addr), "%s!%s", mp->m_host, mp->m_mbox);
/* Sigh, it turns out that the address parser gets messed up
* if you don't call getname() until it returns NULL. */
while (getname(am) != NULL)
- ;
+ ;
}
if ((am = context_find ("alternate-mailboxes")) == NULL)
bool space = false;
bool metachar = false;
for (p = command; *p; p++) {
- if (*p == ' ' || *p == '\t') {
+ if (*p == ' ' || *p == '\t') {
space = true;
} else if (strchr(METACHARS, *p)) {
metachar = true;
*/
if (!space && !metachar) {
- argvarray[0] = mh_xstrdup(r1bindex(command, '/'));
+ argvarray[0] = mh_xstrdup(r1bindex(command, '/'));
argvarray[1] = NULL;
*file = mh_xstrdup(command);
if (argp)
*/
if (space && !metachar) {
- char **split;
+ char **split;
p = mh_xstrdup(command);
split = brkstring(p, " \t", NULL);
if (split[0] == NULL) {
argvarray[4] = NULL;
if (argp)
- *argp = 4;
+ *argp = 4;
return argvarray;
}
free(command);
if (argvarray != NULL) {
- for (i = 0; argvarray[i] != NULL; i++)
+ for (i = 0; argvarray[i] != NULL; i++)
free(argvarray[i]);
free(argvarray);
}
*/
for (i = 0; i < argp; i++) {
- app_msgarg(msgs, vec[i]);
+ app_msgarg(msgs, vec[i]);
}
free(vec);
}
for (i = msgs->size - 1; i >= 0; i--)
- msgs->msgs[i + argp] = msgs->msgs[i];
+ msgs->msgs[i + argp] = msgs->msgs[i];
msgs->size += argp;
*/
for (i = 0; i < argp; i++)
- msgs->msgs[i] = vec[i];
+ msgs->msgs[i] = vec[i];
free(vec);
}
* everything down and push the last character back.
*/
if (i == cc - 1) {
- /*
+ /*
* If we're at the end of the input, there might be
* more room in inbuf; if so, add it there. Otherwise
* push it back to the input.
*/
- if (cc < sizeof(inbuf))
+ if (cc < sizeof(inbuf))
inbuf[cc++] = '\n';
else
ungetc('\n', in);
skipnl = true;
} else {
- /* This only works as long as sizeof(inbuf) == 3 */
+ /* This only works as long as sizeof(inbuf) == 3 */
ungetc(inbuf[cc - 1], in);
if (cc == 3 && i == 0)
inbuf[2] = inbuf[1];
flags = fcntl(sd, F_GETFD, 0);
if (flags != -1)
- fcntl(sd, F_SETFD, flags | FD_CLOEXEC);
+ fcntl(sd, F_SETFD, flags | FD_CLOEXEC);
return sd;
}
char *nd; /* nmh directory pointer */
struct stat st; /* stat() results */
struct passwd *pw; /* getpwuid() results */
- FILE *ib; /* profile and context file pointer */
+ FILE *ib; /* profile and context file pointer */
int failed_to_lock = 0;
/*
SKIPA(); }
#define SETMON() { cp++; \
tw.tw_mon = month_map[(((unsigned char) cp[0]) + ((unsigned char) cp[1])) & 0x1f]; \
- SKIPA(); }
+ SKIPA(); }
#define SETMON_NUM() { tw.tw_mon = atoi(cp)-1; \
- SKIPD(); }
+ SKIPD(); }
#define SETYEAR() { tw.tw_year = atoi(cp); \
- SKIPD(); }
+ SKIPD(); }
#define SETDAY() { tw.tw_mday = atoi(cp); \
tw.tw_flags |= TW_SUCC; \
- SKIPD(); }
+ SKIPD(); }
#define SETTIME() { tw.tw_hour = atoi(cp); \
cp += 2; \
SKIPTOD(); \
if (isascii((unsigned char) *p)) {
asciicount++;
if (qpspecial((unsigned char) *p))
- qpspecialcount++;
+ qpspecialcount++;
} else
eightbitcount++;
}
if (eightbitcount == 0)
- return 0;
+ return 0;
/*
* Some rules from RFC 2047:
*/
if (charset == NULL)
- charset = write_charset_8bit();
+ charset = write_charset_8bit();
if (strcasecmp(charset, "US-ASCII") == 0) {
- inform("Cannot use US-ASCII with 8 bit characters in header");
+ inform("Cannot use US-ASCII with 8 bit characters in header");
return 1;
}
*/
for (i = 0; address_headers[i]; i++) {
- if (strcasecmp(name, address_headers[i]) == 0)
+ if (strcasecmp(name, address_headers[i]) == 0)
return field_encode_address(name, value, encoding, charset);
}
switch (encoding) {
case CE_BASE64:
- return field_encode_base64(name, value, charset);
+ return field_encode_base64(name, value, charset);
case CE_QUOTED:
return field_encode_quoted(name, value, charset, asciicount,
eightbitcount + qpspecialcount, 0);
default:
- inform("Internal error: unknown RFC-2047 encoding type");
+ inform("Internal error: unknown RFC-2047 encoding type");
return 1;
}
}
bool newline = true;
while (*p != '\0') {
- /*
+ /*
* Start a new line, if it's time
*/
- if (newline) {
+ if (newline) {
/*
* If it's the start of the header, we don't need to pad it
*
for (i = 0; i < prefixlen; i++)
*q++ = ' ';
} else {
- /*
+ /*
* A bit of a hack here; the header can contain multiple
* spaces (probably at least one) until we get to the
* actual text. Copy until we get to a non-space.
*/
- output = mh_xmalloc(outlen);
+ output = mh_xmalloc(outlen);
q = output;
while (is_fws(*p))
*q++ = *p++;
ascii--;
} else if (isascii((unsigned char) *p) &&
(phraserules ? qphrasevalid((unsigned char) *p) :
- !qpspecial((unsigned char) *p))) {
+ !qpspecial((unsigned char) *p))) {
*q++ = *p;
ascii--;
} else {
*/
while (*p == ' ' || *p == '\t')
- p++;
+ p++;
/*
* If we had a zero-length prefix, then just encode the whole field
*/
while (prefixlen && ((base64len(strlen(p)) + 7 + charsetlen +
- prefixlen) > ENCODELINELIMIT)) {
+ prefixlen) > ENCODELINELIMIT)) {
/*
* Our very first time, don't pad the line in the front
if (numencode <= 0) {
inform("Internal error: tried to encode %d characters "
- "in base64", numencode);
+ "in base64", numencode);
return 1;
}
*/
while (numencode > 0 && ((*(p + numencode) & 0xc0) == 0x80))
- numencode--;
+ numencode--;
if (numencode == 0) {
- inform("Internal error: could not find start of "
+ inform("Internal error: could not find start of "
"UTF-8 character when base64 encoding header");
return 1;
}
q = output + curlen;
q += snprintf(q, outlen - (q - output), "%s=?%s?B?",
- prefixlen ? " " : "", charset);
+ prefixlen ? " " : "", charset);
if (writeBase64raw((unsigned char *) p, strlen(p),
- (unsigned char *) q) != OK) {
+ (unsigned char *) q) != OK) {
inform("Internal error: base64 encoding of header failed");
return 1;
}
strcat(q, "?=");
if (prefixlen)
- strcat(q, "\n");
+ strcat(q, "\n");
free(*value);
int len = 1;
if (*p == '\0')
- return 0;
+ return 0;
if (isascii((unsigned char) *p) || (((unsigned char) *p) & 0xc0) == 0x80)
- return 0;
+ return 0;
p++;
while ((((unsigned char) *p++) & 0xc0) == 0x80)
- len++;
+ len++;
return len;
}
char *p = str, *q = *value;
while (*q != '\0') {
- if (*q == '\n') {
+ if (*q == '\n') {
/*
* When we get a newline, skip to the next non-whitespace
* character and add a space to replace all of the whitespace
* for the header; we put it back in the encoding routine.
*/
while (is_fws(*q))
- q++;
+ q++;
if (*q == '\0')
- break;
+ break;
*p++ = ' ';
} else {
output = add(" ", output);
for (groupflag = 0; (mp = getname(*value)); ) {
- if ((mn = getm(mp, NULL, 0, errbuf, sizeof(errbuf))) == NULL) {
+ if ((mn = getm(mp, NULL, 0, errbuf, sizeof(errbuf))) == NULL) {
inform("%s: %s", errbuf, mp);
errflag = true;
continue;
*/
if (encoding == CE_UNKNOWN)
- encoding = pref_encoding(asciichars, specialchars,
+ encoding = pref_encoding(asciichars, specialchars,
eightbitchars);
/*
switch (encoding) {
case CE_BASE64:
- if (field_encode_base64(NULL, &mn->m_pers, charset)) {
+ if (field_encode_base64(NULL, &mn->m_pers, charset)) {
errflag = true;
goto out;
}
break;
case CE_QUOTED:
- if (field_encode_quoted(NULL, &mn->m_pers, charset, asciichars,
+ if (field_encode_quoted(NULL, &mn->m_pers, charset, asciichars,
eightbitchars + specialchars, 1)) {
errflag = true;
goto out;
if (mn->m_note[0] != '(' || mn->m_note[len - 1] != ')') {
inform("Internal error: Invalid note field \"%s\"",
- mn->m_note);
+ mn->m_note);
errflag = true;
goto out;
}
*/
if (encoding == CE_UNKNOWN)
- encoding = pref_encoding(asciichars, specialchars,
+ encoding = pref_encoding(asciichars, specialchars,
eightbitchars);
switch (encoding) {
case CE_BASE64:
- if (field_encode_base64(NULL, &tmpbuf, charset)) {
+ if (field_encode_base64(NULL, &tmpbuf, charset)) {
errflag = true;
goto out;
}
break;
case CE_QUOTED:
- if (field_encode_quoted(NULL, &tmpbuf, charset, asciichars,
+ if (field_encode_quoted(NULL, &tmpbuf, charset, asciichars,
eightbitchars + specialchars, 1)) {
errflag = true;
goto out;
if (column != prefixlen) {
if (len + column + 2 > OUTPUTLINELEN) {
- if ((size_t) (prefixlen + 3) < tmpbufsize)
+ if ((size_t) (prefixlen + 3) < tmpbufsize)
tmpbuf = mh_xrealloc(tmpbuf, tmpbufsize = prefixlen + 3);
snprintf(tmpbuf, tmpbufsize, ",\n%*s", column = prefixlen, "");
output = add(tmpbuf, output);
} else {
- output = add(", ", output);
+ output = add(", ", output);
column += 2;
}
}
*specialchars = 0;
for (; *string != '\0'; string++) {
- if ((isascii((unsigned char) *string))) {
+ if ((isascii((unsigned char) *string))) {
(*asciilen)++;
/*
* So, a space is not a valid phrase character, but we're counting
* encoded as an underscore.
*/
if (!qphrasevalid((unsigned char) *string) && *string != ' ')
- (*specialchars)++;
+ (*specialchars)++;
} else {
(*eightbitchars)++;
}
*/
return base64len(ascii + eightbits) < (ascii - specials +
- (specials + eightbits) * 3) ? CE_BASE64 : CE_QUOTED;
+ (specials + eightbits) * 3) ? CE_BASE64 : CE_QUOTED;
}
int status; /* exit or other child process status */
char **vec; /* argument vector for child process */
int vecp; /* Vector index */
- char *program; /* Name of program to execute */
+ char *program; /* Name of program to execute */
static bool did_message; /* set if we've already output a message */
extern struct mailname fmt_mnull;
/* ftable->type (argument type) */
-#define TF_COMP 0 /* component expected */
-#define TF_NUM 1 /* number expected */
-#define TF_STR 2 /* string expected */
-#define TF_EXPR 3 /* component or func. expected */
-#define TF_NONE 4 /* no argument */
-#define TF_MYBOX 5 /* special - get current user's mbox */
-#define TF_NOW 6 /* special - get current unix time */
+#define TF_COMP 0 /* component expected */
+#define TF_NUM 1 /* number expected */
+#define TF_STR 2 /* string expected */
+#define TF_EXPR 3 /* component or func. expected */
+#define TF_NONE 4 /* no argument */
+#define TF_MYBOX 5 /* special - get current user's mbox */
+#define TF_NOW 6 /* special - get current unix time */
#define TF_EXPR_SV 7 /* like expr but save current str reg */
#define TF_NOP 8 /* like expr but no result */
#define TF_MYNAME 9 /* special - get current name of user */
struct ftable {
char *name; /* function name */
char type; /* argument type */
- char f_type; /* fmt type */
+ char f_type; /* fmt type */
char extra; /* arg. type dependent extra info */
char flags;
};
{ "getmymbox", TF_COMP, FT_STR, FT_GETMYMBOX, 0 },
{ "getmyaddr", TF_COMP, FT_LS_ADDR, FT_GETMYADDR, TFL_PUTS },
- { "unquote", TF_EXPR, FT_LS_UNQUOTE, 0, TFL_PUTS },
+ { "unquote", TF_EXPR, FT_LS_UNQUOTE, 0, TFL_PUTS },
{ "bold", TF_BOLD, FT_LS_LIT, 0, TFL_PUTS },
{ "underline", TF_UNDERLN,FT_LS_LIT, 0, TFL_PUTS },
usr_fstring = fstring;
if (reset_comptable || !comptable_initialized) {
- free_comptable();
+ free_comptable();
comptable_initialized = true;
}
break;
case TF_MYNAME:
- LS(t->f_type, getfullname());
+ LS(t->f_type, getfullname());
break;
case TF_MYHOST:
- LS(t->f_type, LocalName(0));
+ LS(t->f_type, LocalName(0));
break;
case TF_LMBOX:
- LS(t->f_type, getlocalmbox());
+ LS(t->f_type, getlocalmbox());
break;
case TF_BOLD:
- LS(t->f_type, get_term_stringcap("bold"));
+ LS(t->f_type, get_term_stringcap("bold"));
break;
case TF_UNDERLN:
- LS(t->f_type, get_term_stringcap("smul"));
+ LS(t->f_type, get_term_stringcap("smul"));
break;
case TF_STNDOUT:
- LS(t->f_type, get_term_stringcap("smso"));
+ LS(t->f_type, get_term_stringcap("smso"));
break;
case TF_RESET:
- LS(t->f_type, get_term_stringcap("sgr0"));
+ LS(t->f_type, get_term_stringcap("sgr0"));
break;
case TF_HASCLR:
- LV(t->f_type, get_term_numcap("colors") > 1);
+ LV(t->f_type, get_term_numcap("colors") > 1);
break;
case TF_FGCOLR:
case TF_BGCOLR: {
struct colormap *cmap = colortable;
- char *code;
+ char *code;
sp = cp - 1;
while (c && c != ')')
while (cmap->colorname != NULL) {
if (strcasecmp(sp, cmap->colorname) == 0)
- break;
+ break;
cmap++;
}
if (! code)
code = get_term_stringparm(t->type == TF_FGCOLR ? "setf" : "setb",
- cmap->nonansinum, 0);
+ cmap->nonansinum, 0);
LS(t->f_type, code);
break;
struct format *fp = fmt;
if (fp) {
- while (! (fp->f_type == FT_DONE && fp->f_value == 0)) {
+ while (! (fp->f_type == FT_DONE && fp->f_value == 0)) {
if (fp->f_flags & FF_STRALLOC)
- free(fp->f_text);
+ free(fp->f_text);
if (fp->f_flags & FF_COMPREF)
- free_component(fp->f_comp);
+ free_component(fp->f_comp);
fp++;
}
free(fmt);
}
if (reset_comptable)
- free_comptable();
+ free_comptable();
}
/*
FINDCOMP(cm, component);
if (cm)
- return 0;
+ return 0;
NEWCOMP(cm, component);
struct comp *cptr;
if (bucket != -1) {
- for (cptr = wantcomp[bucket]; cptr; cptr = cptr->c_next)
+ for (cptr = wantcomp[bucket]; cptr; cptr = cptr->c_next)
if (strcasecmp(component, FENDNULL(cptr->c_name)) == 0)
- cptr->c_text = add(text, cptr->c_text);
+ cptr->c_text = add(text, cptr->c_text);
}
}
struct comp *cm, *cm2;
for (i = 0; i < DIM(wantcomp); i++) {
- cm = wantcomp[i];
+ cm = wantcomp[i];
while (cm != NULL) {
cm2 = cm->c_next;
free_component(cm);
free_component(struct comp *cm)
{
if (--cm->c_refcount <= 0) {
- /* Shouldn't ever be NULL, but just in case ... */
+ /* Shouldn't ever be NULL, but just in case ... */
free(cm->c_name);
free(cm->c_text);
if (cm->c_type & CT_DATE)
free(cm->c_tws);
if (cm->c_type & CT_ADDR && cm->c_mn && cm->c_mn != &fmt_mnull)
mnfree(cm->c_mn);
- free(cm);
+ free(cm);
}
}
*/
for (endofcharset = startofmime;
- *endofcharset != '*' && endofcharset < pp;
+ *endofcharset != '*' && endofcharset < pp;
endofcharset++)
;
*/
if (char_len < 0) {
- altstr = "?";
+ altstr = "?";
char_len = mbtowc(&wide_char, altstr, 1);
}
if (char_len <= 0) {
- break;
+ break;
}
w = wcwidth(wide_char);
buffer[sizeof(buffer)-1] = '\0';
str = buffer;
if (*str == '(')
- str++;
+ str++;
sp = str + strlen(str) - 1;
if (*sp == ')') {
- *sp-- = '\0';
- while (sp >= str)
- if (*sp == ' ')
- *sp-- = '\0';
- else
- break;
+ *sp-- = '\0';
+ while (sp >= str)
+ if (*sp == ' ')
+ *sp-- = '\0';
+ else
+ break;
}
str = memmove(buffer, str, strlen(str) + 1);
} else if (!(str = get_x400_friendly (mn->m_mbox,
/* UNQUOTEs RFC-2822 quoted-string and quoted-pair */
case FT_LS_UNQUOTE:
- if (str) {
+ if (str) {
if (str != buffer)
strncpy(buffer, str, sizeof(buffer));
/* strncpy doesn't NUL-terminate if it fills the buffer */
indent = strlen (sp);
wid -= indent;
if (wid <= 0) {
- die("putaddr -- num register (%d) must be greater "
+ die("putaddr -- num register (%d) must be greater "
"than label width (%d)", value, indent);
}
while ((c = *sp++) && charstring_chars (scanlp) < max) {
/* Close/free the sequence file if it is open */
if (mp->seqhandle)
- lkfclosedata (mp->seqhandle, mp->seqname);
+ lkfclosedata (mp->seqhandle, mp->seqname);
free(mp->seqname);
char *str;
if (default_editor)
- return default_editor;
+ return default_editor;
if (!(str = context_find("editor")) && !(str = getenv("VISUAL")) &&
- !(str = getenv("EDITOR"))) {
+ !(str = getenv("EDITOR"))) {
str = "prompter";
}
int fd;
if (oflags == -1) {
- errno = EINVAL;
+ errno = EINVAL;
return NULL;
}
int fd;
if (oflags == -1) {
- errno = EINVAL;
+ errno = EINVAL;
return NULL;
}
int rc = close(fd);
if (datalocktype == DOT_LOCKING)
- lkclose_dot(fd, name);
+ lkclose_dot(fd, name);
return rc;
}
int fd, rc;
if (f == NULL)
- return 0;
+ return 0;
fd = fileno(f);
rc = fclose(f);
if (datalocktype == DOT_LOCKING)
- lkclose_dot(fd, name);
+ lkclose_dot(fd, name);
return rc;
}
int rc = close(fd);
if (spoollocktype == DOT_LOCKING)
- lkclose_dot(fd, name);
+ lkclose_dot(fd, name);
return rc;
}
int fd, rc;
if (f == NULL)
- return 0;
+ return 0;
fd = fileno(f);
rc = fclose(f);
if (spoollocktype == DOT_LOCKING)
- lkclose_dot(fd, name);
+ lkclose_dot(fd, name);
return rc;
}
switch (ltype) {
case FCNTL_LOCKING:
- return lkopen_fcntl(file, access, mode, failed_to_lock);
+ return lkopen_fcntl(file, access, mode, failed_to_lock);
case DOT_LOCKING:
- return lkopen_dot(file, access, mode, failed_to_lock);
+ return lkopen_dot(file, access, mode, failed_to_lock);
#ifdef HAVE_FLOCK
case FLOCK_LOCKING:
- return lkopen_flock(file, access, mode, failed_to_lock);
+ return lkopen_flock(file, access, mode, failed_to_lock);
#endif /* HAVE_FLOCK */
#ifdef HAVE_LOCKF
case LOCKF_LOCKING:
- return lkopen_lockf(file, access, mode, failed_to_lock);
+ return lkopen_lockf(file, access, mode, failed_to_lock);
#endif /* HAVE_FLOCK */
default:
- die("Internal locking error: unsupported lock type used!");
+ die("Internal locking error: unsupported lock type used!");
}
return -1;
*/
for (i = 0; i < LOCK_RETRIES; i++) {
- if ((fd = open(file, access, mode)) == -1)
+ if ((fd = open(file, access, mode)) == -1)
return -1;
flk.l_start = 0;
*/
locktype = (((access & O_ACCMODE) == O_RDONLY) ? LOCK_SH : LOCK_EX) |
- LOCK_NB;
+ LOCK_NB;
for (i = 0; i < LOCK_RETRIES; i++) {
- if ((fd = open(file, access, mode)) == -1)
+ if ((fd = open(file, access, mode)) == -1)
return -1;
if (flock(fd, locktype) != -1)
access &= ~O_APPEND;
if ((access & O_ACCMODE) == O_RDONLY) {
- access &= ~O_RDONLY;
+ access &= ~O_RDONLY;
access |= O_RDWR;
}
for (i = 0; i < LOCK_RETRIES; i++) {
- if ((fd = open(file, access, mode)) == -1)
+ if ((fd = open(file, access, mode)) == -1)
return -1;
if (lockf(fd, F_TLOCK, 0) != -1) {
* Seek to end if requested
*/
if (saved_access & O_APPEND) {
- lseek(fd, 0, SEEK_END);
+ lseek(fd, 0, SEEK_END);
}
return fd;
}
init_locktype(const char *lockname)
{
if (strcasecmp(lockname, "fcntl") == 0) {
- return FCNTL_LOCKING;
+ return FCNTL_LOCKING;
}
if (strcasecmp(lockname, "lockf") == 0) {
#ifdef HAVE_LOCKF
#endif /* HAVE_FLOCK */
}
if (strcasecmp(lockname, "dot") == 0) {
- return DOT_LOCKING;
+ return DOT_LOCKING;
}
die("Unknown lock type: \"%s\"", lockname);
/* NOTREACHED */
case LX_END:
return DONE;
- case LX_LBRK: /* sigh (2) */
+ case LX_LBRK: /* sigh (2) */
goto get_addr;
case LX_AT: /* sigh (3) */
}
}
- case LX_DOT: /* sigh (1) */
+ case LX_DOT: /* sigh (1) */
pers = add (".", pers);
goto more_phrase;
return NOTOK;
}
- case LX_SEMI: /* no host */
+ case LX_SEMI: /* no host */
case LX_COMA:
case LX_END:
ingrp = glevel;
return domain (buffer);
case LX_SEMI: /* if in group */
- case LX_RBRK: /* no host */
+ case LX_RBRK: /* no host */
case LX_COMA:
case LX_END:
return OK;
host = add (buffer, host);
continue;
- case LX_AT: /* sigh (0) */
+ case LX_AT: /* sigh (0) */
mbox = add (host, add ("%", mbox));
free (host);
host = NULL;
struct addrinfo hints, *res;
if (flag < 0 || flag > 1)
- return NULL;
+ return NULL;
buf = buffer[flag];
getlocalmbox (void)
{
if (username[0] == '\0')
- getuserinfo();
+ getuserinfo();
return localmbox;
}
if ((cp = getenv ("SIGNATURE")) && *cp)
strncpy (fullname, cp, sizeof(fullname));
else if ((cp = context_find("Signature")))
- strncpy (fullname, cp, sizeof(fullname));
+ strncpy (fullname, cp, sizeof(fullname));
fullname[sizeof(fullname) - 1] = '\0';
* At that point, just give up.
*/
netsec_err(errstr, "Internal error: wanted to printf() a total of "
- "%d bytes, but our buffer size was only %d bytes",
+ "%d bytes, but our buffer size was only %d bytes",
rc, nsc->ns_outbufsize);
return NOTOK;
}
if (nsc->ns_snoop_savebuf) {
cb_len += strlen(nsc->ns_snoop_savebuf);
nsc->ns_snoop_savebuf = mh_xrealloc(nsc->ns_snoop_savebuf,
- outlen);
+ outlen);
ptr = nsc->ns_snoop_savebuf;
} else {
ptr = snoopoutbuf;
&xoauth_client_res, &xoauth_client_res_len,
nsc->ns_snoop ? stderr : NULL) != OK) {
netsec_err(errstr, "Internal error: Unable to get OAuth2 "
- "bearer token");
+ "bearer token");
return NOTOK;
}
*/
rc = sasl_client_start(nsc->sasl_conn,
- nsc->sasl_mech ? nsc->sasl_mech : mechlist, NULL,
+ nsc->sasl_mech ? nsc->sasl_mech : mechlist, NULL,
(const char **) &saslbuf, &saslbuflen,
&chosen_mech);
*/
while (rc == SASL_CONTINUE) {
- /*
+ /*
* Call our SASL callback, which will handle the details of
* reading data from the network.
*/
if (! ssl_bio) {
netsec_err(errstr, "Unable to create a SSL BIO: %s",
- ERR_error_string(ERR_get_error(), NULL));
+ ERR_error_string(ERR_get_error(), NULL));
SSL_free(ssl);
return NOTOK;
}
int rc = 127;
if (! errstr)
- return;
+ return;
do {
errbufsize = rc + 1;
#define update(name) \
update_svc_field(&svc->name, #name, svc_name); \
if (svc->name == NULL) { \
- snprintf(errbuf, errbuflen, "%s", #name " is missing"); \
+ snprintf(errbuf, errbuflen, "%s", #name " is missing"); \
errbuf[errbuflen - 1] = '\0'; \
return false; \
}
cp = ansbuf;
while ((i = getchar ()) != '\n') {
if (i == EOF) {
- /*
+ /*
* If we get an EOF, return
*/
if (feof(stdin))
if (ferror(stdin)) {
if (errno == EINTR) {
- clearerr(stdin);
+ clearerr(stdin);
continue;
}
fprintf(stderr, "\nError %s during read\n",
- strerror(errno));
+ strerror(errno));
siglongjmp (sigenv, 1);
}
rl_cmds = ansp;
for (;;) {
- ans = readline(prompt);
+ ans = readline(prompt);
/*
* If we get an EOF, return
*/
cpp = brkstring(ansbuf, " ", NULL);
switch (smatch(*cpp, ansp)) {
case AMBIGSW:
- ambigsw(*cpp, ansp);
+ ambigsw(*cpp, ansp);
continue;
case UNKWNSW:
- printf(" -%s unknown. Hit <CR> for help.\n", *cpp);
+ printf(" -%s unknown. Hit <CR> for help.\n", *cpp);
continue;
default:
return cpp;
NMH_UNUSED (end);
if (start == 0)
- return rl_completion_matches(text, nmh_command_generator);
+ return rl_completion_matches(text, nmh_command_generator);
return NULL;
}
char buf[256];
if (!state) {
- list_index = 0;
+ list_index = 0;
len = strlen(text);
}
while ((name = rl_cmds[list_index].sw)) {
- list_index++;
+ list_index++;
strncpy(buf, name, sizeof(buf));
buf[sizeof(buf) - 1] = '\0';
p = *brkstring(buf, " ", NULL);
continue;
case BODY:
- lkfclosedata (fp, seqfile);
+ lkfclosedata (fp, seqfile);
die("no blank lines are permitted in %s", seqfile);
break;
break;
default:
- lkfclosedata (fp, seqfile);
+ lkfclosedata (fp, seqfile);
die("%s is poorly formatted", seqfile);
}
break; /* break from for loop */
/* check if sequence information has changed */
if (!(mp->msgflags & SEQMOD)) {
- if (mp->seqhandle) {
+ if (mp->seqhandle) {
lkfclosedata (mp->seqhandle, mp->seqname);
mp->seqhandle = NULL;
free(mp->seqname);
int errret, rc;
if (termstatus)
- return;
+ return;
rc = setupterm(NULL, fileno(stdout), &errret);
if (rc != 0 || errret != 1) {
- termstatus = -1;
+ termstatus = -1;
return;
}
termstatus = 1;
initialize_terminfo();
if (termstatus == -1)
- return NULL;
+ return NULL;
termcbufp = termcbuf;
parm = tigetstr(capability);
if (parm == (char *) -1 || parm == NULL) {
- return NULL;
+ return NULL;
}
tputs(parm, 1, termbytes);
initialize_terminfo();
if (termstatus == -1)
- return NULL;
+ return NULL;
termcbufp = termcbuf;
parm = tigetstr(capability);
if (parm == (char *) -1 || parm == NULL) {
- return NULL;
+ return NULL;
}
parm = tparm(parm, arg1, arg2, 0, 0, 0, 0, 0, 0, 0);
initialize_terminfo();
if (termstatus == -1)
- return -1;
+ return -1;
return tigetnum(capability);
}
if ((offset = termcbufp - termcbuf) - 1 >= termcbufsz) {
termcbufsz += 64;
- termcbuf = mh_xrealloc(termcbuf, termcbufsz);
+ termcbuf = mh_xrealloc(termcbuf, termcbufsz);
termcbufp = termcbuf + offset;
}
addlist (char *list, const char *item)
{
if (list)
- list = add (", ", list);
+ list = add (", ", list);
return add (item, list);
}
starttime = time(NULL);
for (;;) {
- fd_set readfds;
+ fd_set readfds;
struct timeval tv;
FD_ZERO(&readfds);
if (stat(file, &s) == -1) {
inform("can't get access and modification times for %s", file);
- preserve_actime_and_modtime = 0;
+ preserve_actime_and_modtime = 0;
}
b.actime = s.st_atime;
case FROMSW:
if (!(cp = *argp++) || *cp == '-')
- die("missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
from = addlist(from, cp);
continue;
case TOSW:
if (!(cp = *argp++) || *cp == '-')
- die("missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
to = addlist(to, cp);
continue;
case CCSW:
if (!(cp = *argp++) || *cp == '-')
- die("missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
cc = addlist(cc, cp);
continue;
case FCCSW:
if (!(cp = *argp++) || *cp == '-')
- die("missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
fcc = addlist(fcc, cp);
continue;
case WIDTHSW:
if (!(cp = *argp++) || *cp == '-')
- die("missing argument to %s", argp[-2]);
+ die("missing argument to %s", argp[-2]);
if ((outputlinelen = atoi(cp)) < 10)
- die("impossible width %d", outputlinelen);
+ die("impossible width %d", outputlinelen);
continue;
case ATFILESW:
dat[4] = 0;
if (!form)
- form = distcomps;
+ form = distcomps;
in = build_form(form, NULL, dat, from, to, cc, fcc, NULL, msgnam);
*/
if ((tmp = fopen(inputfile, "r")) == NULL)
- adios (inputfile, "Unable to open");
+ adios (inputfile, "Unable to open");
/* Get new format string */
nfs = new_fs (form, NULL, NULL);
switch (state) {
case FLD:
case FLDPLUS:
- /*
+ /*
* If we find a component that we're interested in, save
* a copy. We don't do all of that weird buffer switching
* that replout does.
case FMTERR:
case BODY:
case FILEEOF:
- goto finished;
+ goto finished;
default:
- die("m_getfld2() returned %d", state);
+ die("m_getfld2() returned %d", state);
}
}
cptr = fmt_findcomp ("digest");
if (cptr) {
- COMPFREE(cptr);
+ COMPFREE(cptr);
cptr->c_text = getcpy(digest);
}
cptr = fmt_findcomp ("nmh-date");
if (cptr) {
- COMPFREE(cptr);
+ COMPFREE(cptr);
cptr->c_text = getcpy(dtimenow (0));
}
cptr = fmt_findcomp ("nmh-from");
if (cptr) {
- COMPFREE(cptr);
+ COMPFREE(cptr);
cptr->c_text = getcpy(from);
}
cptr = fmt_findcomp ("nmh-to");
if (cptr) {
- COMPFREE(cptr);
+ COMPFREE(cptr);
cptr->c_text = getcpy(to);
}
cptr = fmt_findcomp ("nmh-cc");
if (cptr) {
- COMPFREE(cptr);
+ COMPFREE(cptr);
cptr->c_text = getcpy(cc);
}
cptr = fmt_findcomp ("nmh-subject");
if (cptr) {
- COMPFREE(cptr);
+ COMPFREE(cptr);
cptr->c_text = getcpy(subject);
}
cptr = fmt_findcomp ("fcc");
if (cptr) {
- COMPFREE(cptr);
+ COMPFREE(cptr);
cptr->c_text = getcpy(fcc);
}
continue;
case CHGSW:
- chgflag = true;
+ chgflag = true;
continue;
case NCHGSW:
- chgflag = false;
+ chgflag = false;
continue;
case VERBSW:
PM pm;
if (toplevel > 0)
- printf (LSTFMT2a, atoi (r1bindex (FENDNULL(ct->c_file), '/')));
+ printf (LSTFMT2a, atoi (r1bindex (FENDNULL(ct->c_file), '/')));
else
- printf(toplevel < 0 ? "part " : " ");
+ printf(toplevel < 0 ? "part " : " ");
snprintf (buffer, sizeof(buffer), "%s/%s", FENDNULL(ci->ci_type),
FENDNULL(ci->ci_subtype));
for (pm = ci->ci_first_pm; pm; pm = pm->pm_next) {
printf ("\t %s=\"%s\"\n", pm->pm_name,
- get_param_value(pm, '?'));
+ get_param_value(pm, '?'));
}
/*
case CHECKSW:
case NCHECKSW:
- /* Currently a NOP */
+ /* Currently a NOP */
continue;
case HEADSW:
fprintf (stderr, "%s: %s\n", TYPE_FIELD, cp);
if (*cp == '(' && get_comment (ct->c_file, TYPE_FIELD, &cp,
- &ci->ci_comment) == NOTOK)
+ &ci->ci_comment) == NOTOK)
return NOTOK;
for (dp = cp; istoken (*dp); dp++)
cp++;
if (*cp == '(' && get_comment (ct->c_file, TYPE_FIELD, &cp,
- &ci->ci_comment) == NOTOK)
+ &ci->ci_comment) == NOTOK)
return NOTOK;
if (*cp != '/') {
cp++;
if (*cp == '(' && get_comment (ct->c_file, TYPE_FIELD, &cp,
- &ci->ci_comment) == NOTOK)
+ &ci->ci_comment) == NOTOK)
return NOTOK;
for (dp = cp; istoken (*dp); dp++)
cp++;
if (*cp == '(' && get_comment (ct->c_file, TYPE_FIELD, &cp,
- &ci->ci_comment) == NOTOK)
+ &ci->ci_comment) == NOTOK)
return NOTOK;
if ((status = parse_header_attrs (ct->c_file, TYPE_FIELD, &cp,
- &ci->ci_first_pm, &ci->ci_last_pm,
+ &ci->ci_first_pm, &ci->ci_last_pm,
&ci->ci_comment)) != OK) {
return status == NOTOK ? NOTOK : OK;
}
*/
if (magic && *cp == '*') {
- /*
+ /*
* See if it's a CTE we match on
*/
struct k2v *kv;
fprintf (stderr, "%s: %s\n", DISPO_FIELD, cp);
if (*cp == '(' && get_comment (ct->c_file, DISPO_FIELD, &cp, NULL) ==
- NOTOK) {
+ NOTOK) {
free(dispoheader);
return NOTOK;
}
return NOTOK;
if ((status = parse_header_attrs (ct->c_file, DISPO_FIELD, &cp,
- &ct->c_dispo_first, &ct->c_dispo_last,
+ &ct->c_dispo_first, &ct->c_dispo_last,
NULL)) != OK) {
if (status == NOTOK) {
free(dispoheader);
}
if (buildflag)
- free(dispoheader);
+ free(dispoheader);
else
ct->c_dispo = dispoheader;
e->eb_url = u = mh_xmalloc(strlen(pm->pm_value) + 1);
for (; *p != '\0'; p++) {
- if (! isspace((unsigned char) *p))
+ if (! isspace((unsigned char) *p))
*u++ = *p;
}
vec[vecp++] = e->eb_name;
vec[vecp++] = ce->ce_file,
vec[vecp++] = e->eb_mode && !strcasecmp (e->eb_mode, "ascii")
- ? "ascii" : "binary";
+ ? "ascii" : "binary";
vec[vecp] = NULL;
fflush (stdout);
pid_t child_id;
if ((urlprog = context_find(nmhaccessurl)) && *urlprog == '\0')
- urlprog = NULL;
+ urlprog = NULL;
if (! urlprog) {
- content_error(NULL, ct, "No entry for nmh-access-url in profile");
- return NOTOK;
+ content_error(NULL, ct, "No entry for nmh-access-url in profile");
+ return NOTOK;
}
switch (openExternal(e->eb_parent, ce, file, &fd)) {
- case NOTOK:
+ case NOTOK:
return NOTOK;
case OK:
}
if (!e->eb_url) {
- content_error(NULL, ct, "missing url parameter");
+ content_error(NULL, ct, "missing url parameter");
return NOTOK;
}
}
if ((ce->ce_fp = fopen(ce->ce_file, "w+")) == NULL) {
- content_error(ce->ce_file, ct, "unable to fopen for read/writing");
+ content_error(ce->ce_file, ct, "unable to fopen for read/writing");
return NOTOK;
}
switch (child_id = fork()) {
case NOTOK:
- adios ("fork", "unable to");
+ adios ("fork", "unable to");
/* NOTREACHED */
case OK:
- argsplit_msgarg(&args, urlprog, &program);
+ argsplit_msgarg(&args, urlprog, &program);
app_msgarg(&args, e->eb_url);
app_msgarg(&args, NULL);
dup2(fileno(ce->ce_fp), 1);
/* NOTREACHED */
default:
- if (pidXwait(child_id, NULL)) {
+ if (pidXwait(child_id, NULL)) {
ce->ce_unlink = 1;
return NOTOK;
}
continue;
}
if (*vp == '*' && vp == up - 1) {
- encoded = true;
+ encoded = true;
} else if (partial) {
if (isdigit((unsigned char) *vp))
index = *vp - '0' + index * 10;
* parameter).
*/
if (index == 0) {
- vp = dp;
+ vp = dp;
while (*vp != '\'' && !isspace((unsigned char) *vp) &&
*vp != '\0')
vp++;
valptr = mh_xmalloc(len + 1);
if (*dp == '"') {
- int i;
+ int i;
for (cp = dp + 1, vp = valptr, i = 0; i < len; i++) {
if (*cp == '\\') {
cp++;
}
cp++;
} else {
- strncpy(valptr, cp = dp, len);
+ strncpy(valptr, cp = dp, len);
cp += len;
}
if (index == 0 && encoded) {
free(pp->charset);
- pp->charset = charset;
+ pp->charset = charset;
free(pp->lang);
pp->lang = lang;
}
*/
for (pp = phead; pp != NULL; ) {
- char *p, *q;
+ char *p, *q;
size_t tlen = 0;
int pindex = 0;
for (sp = pp->sechead; sp != NULL; sp = sp->next) {
if (index > 0) {
q += snprintf(q, sizeof(line) - (q - line), "%s*%d",
- params->pm_name, index);
+ params->pm_name, index);
} else {
strncpy(q, params->pm_name, sizeof(line) - (q - line));
q += strlen(q);
if (encode)
i = encode_param(params, q, sizeof(line) - (q - line),
- strlen(params->pm_value + valoff), valoff, index);
+ strlen(params->pm_value + valoff), valoff, index);
else
i = normal_param(params, q, sizeof(line) - (q - line),
- strlen(params->pm_value + valoff), valoff);
+ strlen(params->pm_value + valoff), valoff);
if (i == 0) {
free(paramout);
len += 3;
maxfit -= 3;
} else {
- len++;
+ len++;
maxfit--;
}
/*
fitlimit++;
}
} else {
- /*
+ /*
* Calculate the string length, but add room for quoting \
* and " if necessary. Also account for quotes at beginning
* and end.
switch (*p) {
case '"':
case '\\':
- len++;
+ len++;
maxfit--;
/* FALLTHRU */
default:
(*last)->pm_next = pm;
*last = pm;
} else {
- *first = pm;
+ *first = pm;
*last = pm;
}
while (first != NULL) {
if (strcasecmp(name, first->pm_name) == 0) {
if (fetchonly)
- return first->pm_value;
+ return first->pm_value;
return getcpy(get_param_value(first, replace));
}
first = first->pm_next;
*/
if (!pm->pm_charset || check_charset(pm->pm_charset,
- strlen(pm->pm_charset))) {
+ strlen(pm->pm_charset))) {
return pm->pm_value;
}
*/
default:
return show_content (ct, alternate, textonly,
- inlineonly, fmt);
+ inlineonly, fmt);
}
case CT_TEXT:
}
if (parse_display_string (ct, cp, &xstdin, &xlist, file, buffer,
- sizeof(buffer) - 1, 0)) {
+ sizeof(buffer) - 1, 0)) {
inform("Buffer overflow constructing show command, continuing...");
return NOTOK;
}
seqfile = concat(m_maildir(folder), "/", mh_seq, NULL);
if (seqfile == NULL)
- return NULL;
+ return NULL;
if ((fp = lkfopendata (seqfile, "r", & failed_to_lock)) == NULL) {
if (failed_to_lock)
/*
* Under sendmail, users should add the line
*
- * "| /usr/local/nmh/lib/slocal"
+ * "| /usr/local/nmh/lib/slocal"
*
* to their $HOME/.forward file.
*
* If previous condition failed, don't
* do this - else fall through
*/
- if (!next)
+ if (!next)
continue;
/* FALLTHRU */