From 81a295b53bc89ef97d93380db7a2ab0c129b53a7 Mon Sep 17 00:00:00 2001 From: kevind Date: Tue, 10 Oct 2000 16:40:18 +0000 Subject: [PATCH] * find/pred.c: use function yesno(). --- find/pred.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/find/pred.c b/find/pred.c index d0bc136..b16e836 100644 --- a/find/pred.c +++ b/find/pred.c @@ -67,6 +67,8 @@ #define CLOSEDIR(d) closedir (d) #endif +extern int yesno (); + /* Get or fake the disk device blocksize. Usually defined by sys/param.h (if at all). */ @@ -971,8 +973,6 @@ pred_nouser (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) boolean pred_ok (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) { - int i, yes; - fflush (stdout); /* The draft open standard requires that, in the POSIX locale, the last non-blank character of this prompt be '?'. @@ -982,13 +982,10 @@ pred_ok (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) fprintf (stderr, _("< %s ... %s > ? "), pred_ptr->args.exec_vec.vec[0], pathname); fflush (stderr); - i = getchar (); - yes = (i == 'y' || i == 'Y'); - while (i != EOF && i != '\n') - i = getchar (); - if (!yes) + if (yesno ()) + return pred_exec (pathname, stat_buf, pred_ptr); + else return (false); - return pred_exec (pathname, stat_buf, pred_ptr); } boolean -- 2.11.4.GIT