summaryrefslogtreecommitdiff
path: root/coreutils/cp.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/cp.c')
-rw-r--r--coreutils/cp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c
index 57158c8..ce63201 100644
--- a/coreutils/cp.c
+++ b/coreutils/cp.c
@@ -54,6 +54,8 @@ static int fileAction(const char *fileName, struct stat* statbuf)
strcat(newdestName, "/");
if ( skipName != NULL)
strcat(newdestName, strstr(fileName, skipName));
+ else
+ strcat(newdestName, srcName);
}
return (copyFile(fileName, newdestName, preserveFlag, followLinks));
}