This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] manual: Document %m instead of %a for formatted input.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Will Newton <will dot newton at linaro dot org>
- Cc: Ville Skytta <ville dot skytta at iki dot fi>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Tue, 11 Feb 2014 15:25:15 +0100
- Subject: Re: [PATCH] manual: Document %m instead of %a for formatted input.
- Authentication-results: sourceware.org; auth=none
- References: <20140211140022 dot GB22794 at domone dot podge> <CANu=Dmju04gKm1_G=oBAJo-5oNPjnEjMvnHg0Mk_8zeRR5SrXw at mail dot gmail dot com>
On Tue, Feb 11, 2014 at 02:12:08PM +0000, Will Newton wrote:
> On 11 February 2014 14:00, OndÅej BÃlka <neleai@seznam.cz> wrote:
> > Hi, this is one of patches that sit in bugzilla. It is relatively
> > straightforward improvement, only thing that I changed here is ommiting
> > that %m is GNU extension.
> >
> > Comments?
> >
> >
> > 2013-12-30 Ville Skytta <ville.skytta@iki.fi>
> >
> > * manual/stdio.texi (Dynamic String Input): Recommend %m modifier instead of %a.
> >
> > ---
> > manual/stdio.texi | 15 ++++++++-------
> > 1 file changed, 8 insertions(+), 7 deletions(-)
>
> Looks ok in general. I guess the diff is small enough to not need assignment.
>
> > diff --git a/manual/stdio.texi b/manual/stdio.texi
> > index 7957a2a..78bea79 100644
> > --- a/manual/stdio.texi
> > +++ b/manual/stdio.texi
> > @@ -3730,18 +3730,19 @@ input with a comprehensible error message, not with a crash.
> > @node Dynamic String Input
> > @subsection Dynamically Allocating String Conversions
> >
> > -A GNU extension to formatted input lets you safely read a string with no
> > -maximum size. Using this feature, you don't supply a buffer; instead,
> > -@code{scanf} allocates a buffer big enough to hold the data and gives
> > -you its address. To use this feature, write @samp{a} as a flag
> > -character, as in @samp{%as} or @samp{%a[0-9a-z]}.
> > +A POSIX.1-2008 extension to formatted input lets you safely
> > +read a string with no maximum size. Using this feature, you don't
> > +supply a buffer; instead, @code{scanf} allocates a buffer big enough
> > +to hold the data and gives you its address. To use this feature,
> > +write @samp{m} as a flag character, as in @samp{%ms} or
> > +@samp{%m[0-9a-z]}.
>
> Is it worth mentioning the use of the m flag with the c conversion specifier?
>
Perhaps change last line to following?
+@samp{%m[0-9a-z]} or @samp{%10mc}