damnit.
[oweals/busybox.git] / mv.c
diff --git a/mv.c b/mv.c
index b861ab7e6b2537e052a338eef405788132274aeb..2be3961ca5b06f85e50b0eea35c5b23d31a48f2c 100644 (file)
--- a/mv.c
+++ b/mv.c
@@ -56,7 +56,7 @@ extern int mv_main(int argc, char **argv)
        fprintf(stderr, "%s: not a directory\n", destName);
        exit (FALSE);
     }
-
+    
     while (argc-- > 1) {
        srcName = *(argv++);
        skipName = strrchr(srcName, '/');
@@ -67,6 +67,11 @@ extern int mv_main(int argc, char **argv)
            strcat(newdestName, "/");
            if ( skipName != NULL)
                strcat(newdestName, strstr(srcName, skipName));
+           else
+               strcat(newdestName, srcName);
+           fprintf(stderr, "srcName='%s'\n", srcName);
+           fprintf(stderr, "skipName='%s'\n", skipName);
+           fprintf(stderr, "newdestName='%s'\n", newdestName);
        }
        if (copyFile(srcName, newdestName, FALSE, FALSE)  == FALSE) {
            exit( FALSE);