mirror of
https://github.com/sheumann/hush.git
synced 2024-09-12 00:55:11 +00:00
If /tmp and /home were different partitions, then "mv /tmp/file /home/file"
would delete /home/file even if /tmp/file didn't exist. This fixes that, although the logic of both mv and cp is a bit tangled and should probably be untangled.
This commit is contained in:
parent
c337d29550
commit
3c12ff7c89
@ -99,10 +99,10 @@ DO_MOVE:
|
||||
struct stat source_stat;
|
||||
int source_exists;
|
||||
|
||||
if (errno != EXDEV) {
|
||||
if (errno != EXDEV ||
|
||||
(source_exists = cp_mv_stat(*argv, &source_stat)) < 1) {
|
||||
bb_perror_msg("unable to rename `%s'", *argv);
|
||||
}
|
||||
else if ((source_exists = cp_mv_stat(*argv, &source_stat)) >= 0) {
|
||||
} else {
|
||||
if (dest_exists) {
|
||||
if (dest_exists == 3) {
|
||||
if (source_exists != 3) {
|
||||
|
Loading…
Reference in New Issue
Block a user