summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-04-17 20:59:29 +0000
committerLennart Poettering <lennart@poettering.net>2006-04-17 20:59:29 +0000
commit9f0083dea13ca1168a3d7272d83693fd03603dd4 (patch)
tree2f8d77d3c503b89d7eb1d538abb2c5dc5bfe6e29
parent437286464806e75172e099a49566758b17081f9f (diff)
If a file already exists, and the user chooses not to replace it, don't treat this as an error
git-svn-id: file:///home/lennart/svn/public/syrep/trunk@98 07ea20a6-d2c5-0310-9e02-9ef735347d72
-rw-r--r--src/merge.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/merge.c b/src/merge.c
index 581e8b9..7cca266 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -161,11 +161,13 @@ static int do_copy(const char *a, const char *b) {
if (errno != EEXIST)
return r;
- if (!(q = question("Replace existing file?", "ny")))
+ if (!(q = question("Replace existing file?", "ny"))) {
+ errno = EINVAL;
return -1;
+ }
- if (q != 'y')
- return -1;
+ if (q != 'y') /* Treat as success */
+ return 0;
}
return copy_proc(a, b, 1);