The function had had a bad name and it's use in mhl.c was complex, anyway.
void context_read(void);
void context_replace(char *, char *);
void context_save(void);
-char **copyip(char **, char **, int);
void cpydata(int, int, char *, char *);
void cpydgst(int, int, char *, char *);
int decode_rfc2047(char *, char *, size_t);
check_charset.c concat.c context_del.c \
context_find.c context_foil.c context_read.c \
context_replace.c context_save.c \
- copyip.c cpydata.c cpydgst.c crawl_folders.c \
+ cpydata.c cpydgst.c crawl_folders.c \
discard.c done.c dtime.c dtimep.c \
error.c ext_hook.c folder_addmsg.c folder_delmsgs.c \
folder_free.c folder_pack.c folder_read.c \
+++ /dev/null
-/*
-** copyip.c -- copy a string array and return pointer to end
-**
-** 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>
-
-
-char **
-copyip(char **p, char **q, int len_q)
-{
- while (*p && --len_q > 0)
- *q++ = *p++;
- *q = NULL;
-
- return q;
-}
struct msgs *mp;
if (ci->ci_magic) {
+ int i;
+
ap = brkstring(ci->ci_magic, " ", "\n");
- copyip(ap, arguments, MAXARGS);
+ for (i=0; ap[i] && i<MAXARGS-1; i++) {
+ arguments[i] = ap[i];
+ }
+ arguments[i] = NULL;
+
} else {
arguments[0] = seq_cur;
arguments[1] = NULL;
mhl_format(char *file, int width)
{
int i;
- char *bp, *cp, **ip;
+ char *bp, *cp;
char *ap, buffer[BUFSIZ], name[NAMESZ];
struct mcomp *c1;
struct stat st;
global.c_width = i;
global.c_cwidth = -1;
global.c_flags = 0;
- *(ip = ignores) = NULL;
+ *ignores = NULL;
while (vfgets(fp, &ap) == OK) {
bp = ap;
** it to the end of the current "ignores" list.
*/
if (!mh_strcasecmp(name, "ignores")) {
- char **tmparray, **p;
+ char **tmparray;
int n = 0;
/* split the fields */
tmparray = brkstring(getcpy(++parptr), ",",
NULL);
-
- /* count number of fields split */
- p = tmparray;
- while (*p++)
- n++;
-
/*
** copy pointers to split fields
** to ignores array
*/
- ip = copyip(tmparray, ip,
- MAXARGS - num_ignores);
- num_ignores += n;
+ while (tmparray[n] && num_ignores<MAXARGS-1) {
+ ignores[num_ignores++] = tmparray[n++];
+ }
+ ignores[num_ignores] = NULL;
continue;
}
parptr = bp;