aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/cp.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-09-07 17:12:57 -0500
committerRob Landley <rob@landley.net>2015-09-07 17:12:57 -0500
commitb1353fb9185928249f273340c601244291e269fe (patch)
treee75f4ee65b3f88a1fd436b9605826c1df160f514 /toys/posix/cp.c
parent960100aa9cb588a73125d43ec0b0a7152a95b43f (diff)
downloadtoybox-b1353fb9185928249f273340c601244291e269fe.tar.gz
Remove prompt argument from yesno(), caller can fprintf(stderr, "blah") itself.
This fixes the build break, the change to yesno() prototype accidentally got checked in last commit. (Oops, sorry.)
Diffstat (limited to 'toys/posix/cp.c')
-rw-r--r--toys/posix/cp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toys/posix/cp.c b/toys/posix/cp.c
index 5a55f40b..2b032fe6 100644
--- a/toys/posix/cp.c
+++ b/toys/posix/cp.c
@@ -173,7 +173,7 @@ int cp_node(struct dirtree *try)
fprintf(stderr, "%s: overwrite '%s'", toys.which->name,
s = dirtree_path(try, 0));
free(s);
- if (!yesno("", 1)) return 0;
+ if (!yesno(1)) return 0;
}
}
@@ -348,11 +348,11 @@ void cp_main(void)
// Try to interpret as letters, commas won't set anything this doesn't.
for (s = TT.c.preserve; *s; s++) {
for (i=0; i<ARRAY_LEN(preserve); i++)
- if (*s == *preserve[i]) TT.pflags |= 1<<i;
+ if (*s == *preserve[i]) break;
if (i == ARRAY_LEN(preserve)) {
if (*s == 'a') TT.pflags = ~0;
else break;
- }
+ } else TT.pflags |= 1<<i;
}
if (*s) error_exit("bad --preserve=%s", pre);
@@ -381,7 +381,7 @@ void cp_main(void)
&& ((toys.optflags & FLAG_i) || !(st.st_mode & 0222)))
{
fprintf(stderr, "%s: overwrite '%s'", toys.which->name, TT.destname);
- if (!yesno("", 1)) rc = 0;
+ if (!yesno(1)) rc = 0;
else unlink(TT.destname);
}
}