We don't want to use copy() anymore; but kept it for concat() only
authormarkus schnalke <meillo@marmaro.de>
Fri, 9 Dec 2011 17:21:27 +0000 (18:21 +0100)
committermarkus schnalke <meillo@marmaro.de>
Fri, 9 Dec 2011 17:21:27 +0000 (18:21 +0100)
h/prototypes.h
sbr/Makefile.in
sbr/concat.c
sbr/copy.c [deleted file]
uip/rmf.c

index b7d6bfb..5e5672c 100644 (file)
@@ -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 *);
index 7780970..b42dd49 100644 (file)
@@ -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  \
index 4c3fcff..5c519e9 100644 (file)
 #include <h/utils.h>
 
 
+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 (file)
index 80a1e54..0000000
+++ /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 <h/mh.h>
-
-char *
-copy(char *from, char *to)
-{
-       while ((*to = *from)) {
-               to++;
-               from++;
-       }
-       return (to);
-}
index 00104cf..3808f54 100644 (file)
--- 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