Re: [hackers] [sbase][PATCH] cp: add -i flag

2025-04-19 Thread Roberto E. Vargas Caballero
On Sat, Apr 19, 2025 at 11:20:48AM +, NRK wrote: > On Sat, Apr 19, 2025 at 12:37:35PM +0200, Quentin Rameau wrote: > This I'm fairly certain isn't allowed, we need to read a *single line* > not "discard what's there and then read a line". > Also, the line may not be coming from a tty either: A

Re: [hackers] [sbase][PATCH] cp: add -i flag

2025-04-19 Thread Roberto E. Vargas Caballero
Hi, On Sat, Apr 19, 2025 at 11:20:48AM +, NRK wrote: > It does still allow discarding trailing chars, right? Since "yes" > matches "^[yY]". > > (Also, does sbase deal with the whole locale mess?) No, and it means that we have to use the default locale that is the C locale, that in the case o

Re: [hackers] [sbase][PATCH] cp: add -i flag

2025-04-19 Thread NRK
On Sat, Apr 19, 2025 at 12:37:35PM +0200, Quentin Rameau wrote: > Now POSIX specifies: > > Affirmative Response > An input string that matches one of the responses acceptable to the > LC_MESSAGES category keyword *yesexpr*, matching an extended regular > expression in the current locale. > > LC_M

Re: [hackers] [sbase][PATCH] cp: add -i flag

2025-04-19 Thread NRK
At a glance this looks okay, aside from what Quentin mentioned about POSIX disallowing trimming leading chars. Also it seems like your mail client is messing up the indentation. It's better to just attach the patch as a file. But I'd wait until Roberto responds to Quentin's mail on the POSIX issue

Re: [hackers] [sbase][PATCH] cp: add -i flag

2025-04-19 Thread Quentin Rameau
> > - It happens to me that I typo things in that context like "uyes", > > resulting here in a negative answer. > > That's on me, but that's pretty annoying. > > > > It would be nice to check if the answer is either clear positive, > > or clear negative, and loop until it actually is one of both,

Re: [hackers] [surf] Maintenance status?

2025-04-19 Thread Artyom Bologov
Hi Quentin, > My bad, I didn't even chime directly into the conversation, > although we exchanged internally a bit on IRC, > but I agreed mostly with what Hiltjo said and and forgot about it. It's okay, thanks for looking into it in the end! > Also as webkitgtk made the switch to GTK4, the whole

Re: [hackers] [sbase][PATCH] cp: add -i flag

2025-04-19 Thread Quentin Rameau
hi, > diff --git a/libutil/confirm.c b/libutil/confirm.c > new file mode 100644 > index 000..4fa48fb > --- /dev/null > +++ b/libutil/confirm.c > @@ -0,0 +1,21 @@ > +/* See LICENSE file for copyright and license details. */ > +#include > +#include > + > +#include "../util.h" > + > +int confir

Re: [hackers] [sbase][PATCH] cp: add -i flag

2025-04-19 Thread Roberto E. Vargas Caballero
Hi, On Sat, Apr 19, 2025 at 12:37:35PM +0200, Quentin Rameau wrote: > - It happens to me that I typo things in that context like "uyes", > resulting here in a negative answer. > That's on me, but that's pretty annoying. > > It would be nice to check if the answer is either clear positive, > or cl

Re: [hackers] [sbase][PATCH] cp: add -i flag

2025-04-19 Thread Quentin Rameau
> And not only that, flushing an input stream is undefined behaviour, > though it was a common practice in many different unix systems. Well, I didn't mean litteraly using fflush() on stdin, but emptying it before asking for input.