From: markus schnalke Date: Sat, 24 Mar 2012 13:02:18 +0000 (+0100) Subject: In-sourced copyip() and could make the code simpler. X-Git-Tag: mmh-thesis-end~206 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=1577ee015a08dd21f0f57f8a8f9a9396c31e884d;p=mmh In-sourced copyip() and could make the code simpler. The function had had a bad name and it's use in mhl.c was complex, anyway. --- diff --git a/h/prototypes.h b/h/prototypes.h index b05535d..3c0dc3c 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -36,7 +36,6 @@ int context_foil(char *); 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); diff --git a/sbr/Makefile.in b/sbr/Makefile.in index d96807c..5de54a2 100644 --- a/sbr/Makefile.in +++ b/sbr/Makefile.in @@ -49,7 +49,7 @@ SRCS = addrsbr.c ambigsw.c brkstring.c \ 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 \ diff --git a/sbr/copyip.c b/sbr/copyip.c deleted file mode 100644 index e5ded82..0000000 --- a/sbr/copyip.c +++ /dev/null @@ -1,20 +0,0 @@ -/* -** 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 - - -char ** -copyip(char **p, char **q, int len_q) -{ - while (*p && --len_q > 0) - *q++ = *p++; - *q = NULL; - - return q; -} diff --git a/uip/mhbuild.c b/uip/mhbuild.c index 3432ccc..3ed31f9 100644 --- a/uip/mhbuild.c +++ b/uip/mhbuild.c @@ -1058,8 +1058,14 @@ use_forw: 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