From: markus schnalke Date: Fri, 9 Dec 2011 17:21:27 +0000 (+0100) Subject: We don't want to use copy() anymore; but kept it for concat() only X-Git-Tag: mmh-thesis-end~462 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=552fd7253e5ee9e554c5c7a8248a6322aa4363bb;p=mmh We don't want to use copy() anymore; but kept it for concat() only --- diff --git a/h/prototypes.h b/h/prototypes.h index b7d6bfb..5e5672c 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -38,7 +38,6 @@ int context_foil(char *); void context_read(void); void context_replace(char *, char *); void context_save(void); -char *copy(char *, char *); char **copyip(char **, char **, int); void cpydata(int, int, char *, char *); void cpydgst(int, int, char *, char *); diff --git a/sbr/Makefile.in b/sbr/Makefile.in index 7780970..b42dd49 100644 --- a/sbr/Makefile.in +++ b/sbr/Makefile.in @@ -53,7 +53,7 @@ SIGNAL_H = @SIGNAL_H@ SRCS = addrsbr.c ambigsw.c atooi.c brkstring.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 \ + context_replace.c context_save.c \ copyip.c cpydata.c cpydgst.c crawl_folders.c \ discard.c done.c dtime.c dtimep.c \ error.c ext_hook.c fdcompare.c folder_addmsg.c folder_delmsgs.c \ diff --git a/sbr/concat.c b/sbr/concat.c index 4c3fcff..5c519e9 100644 --- a/sbr/concat.c +++ b/sbr/concat.c @@ -11,6 +11,17 @@ #include +static char * +copy(char *from, char *to) +{ + while ((*to = *from)) { + to++; + from++; + } + return (to); +} + + char * concat(char *s1, ...) { diff --git a/sbr/copy.c b/sbr/copy.c deleted file mode 100644 index 80a1e54..0000000 --- a/sbr/copy.c +++ /dev/null @@ -1,19 +0,0 @@ -/* -** copy.c -- copy a string and return pointer to null byte terminator -** -** 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 * -copy(char *from, char *to) -{ - while ((*to = *from)) { - to++; - from++; - } - return (to); -} diff --git a/uip/rmf.c b/uip/rmf.c index 00104cf..3808f54 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -92,9 +92,10 @@ main(int argc, char **argv) interactive = defolder; if (strchr(folder, '/') && (*folder != '/') && (*folder != '.')) { - for (cp = copy(folder, newfolder); - cp > newfolder && *cp != '/'; cp--) - continue; + strcpy(newfolder, folder); + cp = newfolder + strlen(newfolder); + while (cp > newfolder && *cp != '/') + cp--; if (cp > newfolder) *cp = '\0'; else