From b1353fb9185928249f273340c601244291e269fe Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 7 Sep 2015 17:12:57 -0500 Subject: 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.) --- toys/posix/rm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'toys/posix/rm.c') diff --git a/toys/posix/rm.c b/toys/posix/rm.c index 5523a98c..f591c64d 100644 --- a/toys/posix/rm.c +++ b/toys/posix/rm.c @@ -39,9 +39,10 @@ static int do_rm(struct dirtree *try) && (!S_ISLNK(try->st.st_mode) && faccessat(fd, try->name, W_OK, 0))) or++; if (!(dir && try->again) && ((or && isatty(0)) || (flags & FLAG_i))) { char *s = dirtree_path(try, 0); - fprintf(stderr, "rm %s%s", or ? "ro " : "", dir ? "dir " : ""); - or = yesno(s, 0); + + fprintf(stderr, "rm %s%s%s", or ? "ro " : "", dir ? "dir " : "", s); free(s); + or = yesno(0); if (!or) goto nodelete; } @@ -57,10 +58,11 @@ static int do_rm(struct dirtree *try) if (try->symlink) goto skip; if (flags & FLAG_i) { char *s = dirtree_path(try, 0); + // This is the section 2(d) prompt. (Yes, posix says to prompt twice.) - fprintf(stderr, "rmdir "); - or = yesno(s, 0); + fprintf(stderr, "rmdir %s", s); free(s); + or = yesno(0); if (!or) goto nodelete; } } -- cgit v1.2.3