Re: sscanf: implement basic character sets

2016-04-05 Thread Jessica Yu
+++ Shahbaz Youssefi [05/04/16 10:32 -0400]: Note: CC me I just read on lwn about the implementation of `%[` in sscanf. Just wanted to point out my implementation (which supports `]` ranges (`-`) and negation (`^`)) and let you know that you are free to take code/inspiration from it: https://gi

RE: [PATCH v4] sscanf: implement basic character sets

2016-04-05 Thread Shahbaz Youssefi
Note: CC me I just read on lwn about the implementation of `%[` in sscanf. Just wanted to point out my implementation (which supports `]` ranges (`-`) and negation (`^`)) and let you know that you are free to take code/inspiration from it: https://github.com/ShabbyX/kio/blob/master/src/scanf.c#L3

Re: sscanf: implement basic character sets

2016-03-07 Thread Jessica Yu
+++ Andrew Morton [07/03/16 15:24 -0800]: On Mon, 7 Mar 2016 18:12:20 -0500 Jessica Yu wrote: +++ Jessica Yu [26/02/16 15:28 -0500]: >+++ Jessica Yu [26/02/16 15:20 -0500]: >>Implement basic character sets for the '%[' conversion specifier. >> >>The '%[' conversion specifier matches a nonempty

Re: sscanf: implement basic character sets

2016-03-07 Thread Rasmus Villemoes
On Tue, Mar 08 2016, Andrew Morton wrote: >> > >> >Since this version is largely based on Rasmus' sample bitmap code >> >(with only very minor tweaks), what is the best way to provide >> >attribution in this case? A Suggested-by: tag or another >> >Signed-off-by: tag (since actual code is involve

Re: sscanf: implement basic character sets

2016-03-07 Thread Andrew Morton
On Mon, 7 Mar 2016 18:12:20 -0500 Jessica Yu wrote: > +++ Jessica Yu [26/02/16 15:28 -0500]: > >+++ Jessica Yu [26/02/16 15:20 -0500]: > >>Implement basic character sets for the '%[' conversion specifier. > >> > >>The '%[' conversion specifier matches a nonempty sequence of characters > >>from th

Re: sscanf: implement basic character sets

2016-03-07 Thread Jessica Yu
+++ Jessica Yu [26/02/16 15:28 -0500]: +++ Jessica Yu [26/02/16 15:20 -0500]: Implement basic character sets for the '%[' conversion specifier. The '%[' conversion specifier matches a nonempty sequence of characters from the specified set of accepted (or with '^', rejected) characters between t

Re: sscanf: implement basic character sets

2016-03-07 Thread Jessica Yu
+++ Rasmus Villemoes [03/03/16 00:49 +0100]: On Fri, Feb 26 2016, Jessica Yu wrote: @@ -2714,6 +2718,57 @@ int vsscanf(const char *buf, const char *fmt, va_list args) num++; } continue; + /* +* Warning: This

Re: [PATCH v4] sscanf: implement basic character sets

2016-03-02 Thread Rasmus Villemoes
On Fri, Feb 26 2016, Jessica Yu wrote: > @@ -2714,6 +2718,57 @@ int vsscanf(const char *buf, const char *fmt, va_list > args) > num++; > } > continue; > + /* > + * Warning: This implementation of the '[' conversion specif

Re: sscanf: implement basic character sets

2016-02-26 Thread Jessica Yu
+++ Jessica Yu [26/02/16 15:20 -0500]: Implement basic character sets for the '%[' conversion specifier. The '%[' conversion specifier matches a nonempty sequence of characters from the specified set of accepted (or with '^', rejected) characters between the brackets. The substring matched is to

[PATCH v4] sscanf: implement basic character sets

2016-02-26 Thread Jessica Yu
Implement basic character sets for the '%[' conversion specifier. The '%[' conversion specifier matches a nonempty sequence of characters from the specified set of accepted (or with '^', rejected) characters between the brackets. The substring matched is to be made up of characters in (or not in)

Re: sscanf: implement basic character sets

2016-02-23 Thread Jessica Yu
+++ Rasmus Villemoes [23/02/16 23:47 +0100]: On Tue, Feb 23 2016, Jessica Yu wrote: Implement basic character sets for the '%[]' conversion specifier. lib/vsprintf.c | 41 + 1 file changed, 41 insertions(+) diff --git a/lib/vsprintf.c b/lib/vsprintf.

Re: sscanf: implement basic character sets

2016-02-23 Thread Andrew Morton
On Wed, 24 Feb 2016 00:13:47 -0500 Jessica Yu wrote: > >> This patch adds support for the '%[' conversion specifier for sscanf(). > >> This is useful in cases where we'd like to match substrings delimited by > >> something other than spaces. The original motivation for this patch > >> actually ca

Re: sscanf: implement basic character sets

2016-02-23 Thread Jessica Yu
+++ Andrew Morton [23/02/16 14:05 -0800]: On Tue, 23 Feb 2016 15:38:22 -0500 Jessica Yu wrote: Implement basic character sets for the '%[]' conversion specifier. The '%[]' conversion specifier matches a nonempty sequence of characters from the specified set of accepted (or with '^', rejected)

Re: [PATCH v3] sscanf: implement basic character sets

2016-02-23 Thread Rasmus Villemoes
On Tue, Feb 23 2016, Rasmus Villemoes wrote: > On that note, it seems that your field width handling is off-by-one. Sorry about that, it's me who's off-by-one. Rasmus > To get rid of the allocation, why not use a small bitmap? Something like > > { > char *s = (char *)va_arg(args, char *); >

Re: [PATCH v3] sscanf: implement basic character sets

2016-02-23 Thread Rasmus Villemoes
On Tue, Feb 23 2016, Jessica Yu wrote: > Implement basic character sets for the '%[]' conversion specifier. > > > lib/vsprintf.c | 41 + > 1 file changed, 41 insertions(+) > > diff --git a/lib/vsprintf.c b/lib/vsprintf.c > index 525c8e1..983358a 100644 > -

Re: [PATCH v3] sscanf: implement basic character sets

2016-02-23 Thread Andrew Morton
On Tue, 23 Feb 2016 15:38:22 -0500 Jessica Yu wrote: > Implement basic character sets for the '%[]' conversion specifier. > > The '%[]' conversion specifier matches a nonempty sequence of characters > from the specified set of accepted (or with '^', rejected) characters > between the brackets. T

Re: [PATCH v3] sscanf: implement basic character sets

2016-02-23 Thread Kees Cook
On Tue, Feb 23, 2016 at 12:38 PM, Jessica Yu wrote: > Implement basic character sets for the '%[]' conversion specifier. > > The '%[]' conversion specifier matches a nonempty sequence of characters > from the specified set of accepted (or with '^', rejected) characters > between the brackets. The

[PATCH v3] sscanf: implement basic character sets

2016-02-23 Thread Jessica Yu
Implement basic character sets for the '%[]' conversion specifier. The '%[]' conversion specifier matches a nonempty sequence of characters from the specified set of accepted (or with '^', rejected) characters between the brackets. The substring matched is to be made up of characters in (or not in

Re: sscanf: implement basic character sets

2016-02-23 Thread Jessica Yu
+++ Kees Cook [23/02/16 11:00 -0800]: On Tue, Feb 23, 2016 at 2:56 AM, Andy Shevchenko wrote: On Mon, 2016-02-22 at 16:24 -0500, Jessica Yu wrote: Implement basic character sets for the '%[]' conversion specifier. What part of the kernel will be using this feature, by the way? I explained

Re: sscanf: implement basic character sets

2016-02-23 Thread Jessica Yu
+++ Andy Shevchenko [23/02/16 12:56 +0200]: On Mon, 2016-02-22 at 16:24 -0500, Jessica Yu wrote: Implement basic character sets for the '%[]' conversion specifier. The '%[]' conversion specifier matches a nonempty sequence of characters from the specified set of accepted (or with '^', rejected)

Re: [PATCH v2] sscanf: implement basic character sets

2016-02-23 Thread Kees Cook
On Tue, Feb 23, 2016 at 2:56 AM, Andy Shevchenko wrote: > On Mon, 2016-02-22 at 16:24 -0500, Jessica Yu wrote: >> Implement basic character sets for the '%[]' conversion specifier. What part of the kernel will be using this feature, by the way? -Kees -- Kees Cook Chrome OS & Brillo Security

Re: [PATCH v2] sscanf: implement basic character sets

2016-02-23 Thread Andy Shevchenko
On Mon, 2016-02-22 at 16:24 -0500, Jessica Yu wrote: > Implement basic character sets for the '%[]' conversion specifier. > > The '%[]' conversion specifier matches a nonempty sequence of > characters > from the specified set of accepted (or with '^', rejected) characters > between the brackets. T

[PATCH v2] sscanf: implement basic character sets

2016-02-22 Thread Jessica Yu
Implement basic character sets for the '%[]' conversion specifier. The '%[]' conversion specifier matches a nonempty sequence of characters from the specified set of accepted (or with '^', rejected) characters between the brackets. The substring matched is to be made up of characters in (or not in

Re: sscanf: implement basic character sets

2016-02-22 Thread Jessica Yu
+++ Andy Shevchenko [22/02/16 12:13 +0200]: On Fri, 2016-02-19 at 20:22 -0500, Jessica Yu wrote: Implement basic character sets for the '%[]' conversion specifier. The '%[]' conversion specifier matches a nonempty sequence of characters from the specified set of accepted (or with '^', rejected)

Re: [PATCH 1/1] sscanf: implement basic character sets

2016-02-22 Thread Andy Shevchenko
On Fri, 2016-02-19 at 20:22 -0500, Jessica Yu wrote: > Implement basic character sets for the '%[]' conversion specifier. > > The '%[]' conversion specifier matches a nonempty sequence of > characters > from the specified set of accepted (or with '^', rejected) characters > between the brackets. T

[PATCH 1/1] sscanf: implement basic character sets

2016-02-19 Thread Jessica Yu
Implement basic character sets for the '%[]' conversion specifier. The '%[]' conversion specifier matches a nonempty sequence of characters from the specified set of accepted (or with '^', rejected) characters between the brackets. The substring matched is to be made up of characters in (or not in