From 9f0083dea13ca1168a3d7272d83693fd03603dd4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 17 Apr 2006 20:59:29 +0000 Subject: 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 --- src/merge.c | 8 +++++--- 1 file 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); -- cgit