From df8c4e9cd15bfc2c5cb4c854a8f876c02c2eb1d6 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Mon, 24 Apr 2017 08:38:56 -0400 Subject: fcopy - fix trailing char --- src/fcopy/main.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/fcopy/main.c b/src/fcopy/main.c index 88379001c..b9d2c19a8 100644 --- a/src/fcopy/main.c +++ b/src/fcopy/main.c @@ -322,6 +322,12 @@ int main(int argc, char **argv) { exit(1); } + // trim trailing chars + if (src[strlen(src) - 1] == '/') + src[strlen(src) - 1] = '\0'; + if (dest[strlen(dest) - 1] == '/') + dest[strlen(dest) - 1] = '\0'; + // check the two files; remove ending / int len = strlen(src); if (src[len - 1] == '/') -- cgit v1.2.3-70-g09d2