diff options
author | tjr <tjr@FreeBSD.org> | 2002-06-16 04:06:58 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-06-16 04:06:58 +0000 |
commit | 63d8853dda2ea433af6527a4cb8d35284f7ddc26 (patch) | |
tree | 62257267063809043e999912d9318ffa92024219 /bin/mv | |
parent | 8da8ab73f43e5508fec262ba4a1d38aeaa8e55ef (diff) | |
download | FreeBSD-src-63d8853dda2ea433af6527a4cb8d35284f7ddc26.zip FreeBSD-src-63d8853dda2ea433af6527a4cb8d35284f7ddc26.tar.gz |
When trying to emulate a cross-device move operation with cp and rm, add
a "--" argument after the options so filenames with leading dashes are
handled correctly.
PR: 39318
Submitted by: Serge van den Boom <svdb@stack.nl>
MFC after: 1 week
Diffstat (limited to 'bin/mv')
-rw-r--r-- | bin/mv/mv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 43ca99c..f8dc938 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -336,7 +336,7 @@ copy(char *from, char *to) int pid, status; if ((pid = fork()) == 0) { - execl(_PATH_CP, "mv", vflg ? "-PRpv" : "-PRp", from, to, + execl(_PATH_CP, "mv", vflg ? "-PRpv" : "-PRp", "--", from, to, (char *)NULL); warn("%s", _PATH_CP); _exit(1); @@ -355,7 +355,7 @@ copy(char *from, char *to) return (1); } if (!(pid = vfork())) { - execl(_PATH_RM, "mv", "-rf", from, (char *)NULL); + execl(_PATH_RM, "mv", "-rf", "--", from, (char *)NULL); warn("%s", _PATH_RM); _exit(1); } |