Re: [hackers] [sbase][patch] find: empty line means no for -ok

From: Wolfgang Corcoran-Mathe <first.lord.of.teal_AT_gmail.com>
Date: Thu, 18 Jun 2015 18:57:51 -0400

emg,

Quoth Evan Gates on Thu, Jun 18 2015 14:47 -0700:
> diff --git a/find.c b/find.c
> index 186263b..0de1951 100644
> --- a/find.c
> +++ b/find.c
> _AT_@ -415,10 +415,9 @@ pri_ok(struct arg *arg)
> reply = fgetc(stdin);
>
> /* throw away rest of line */
> - while ((c = fgetc(stdin)) != '\n' && c != EOF)
> - /* FIXME: what if the first character of the rest of the line is a null
> - * byte? */
> - ;
> + if (c != '\n')
> + while ((c = fgetc(stdin)) != '\n' && c != EOF)
> + ;

I think you meant

    if (reply != '\n')
        ...

Regards,

-- 
WCM
Received on Fri Jun 19 2015 - 00:57:51 CEST

This archive was generated by hypermail 2.3.0 : Fri Jun 19 2015 - 01:00:11 CEST