Re: Rev 8911: Honor 0x and 0 prefixes as numeric base indication when parsing squid.conf in http://squid-cache.org/bzr/squid3/trunk/

From: Alex Rousskov <rousskov@dont-contact.us>
Date: Thu, 03 Apr 2008 08:24:54 -0600

On Thu, 2008-04-03 at 23:05 +1300, Amos Jeffries wrote:
> Is the following a sign that bundlebuggy is working in two locations now?

The following is the message I had to manually forward to the commit
list because I have not yet learned how to configure bzr to
automatically pick sendto addresses based on the branch. The trunk
commit message was sent to me and I forwarded it.

I am committing a lot of stuff to the eCAP branch and I did not want to
spam the commit list with that...

Cheers,

Alex.

> Alex Rousskov wrote:
> > At http://squid-cache.org/bzr/squid3/trunk/
> >
> > ------------------------------------------------------------
> > revno: 8911
> > revision-id:rousskov@measurement-factory.com-20080403044141-8rtnfxhod6c9wisj
> > parent: hno@squid-cache.org-20080402001151-f7d73mbt5kcbrmt4
> > committer: Alex Rousskov <rousskov@measurement-factory.com>
> > branch nick: trunk
> > timestamp: Wed 2008-04-02 22:41:41 -0600
> > message:
> > Honor 0x and 0 prefixes as numeric base indication when parsing squid.conf
> > integer options.
> >
> > Squid3 parses squid.conf file integers as decimal numbers while Squid2 honors
> > 0 and 0x prefixes (indicating octal and hex numbers). The later functionality
> > is needed for things like unmask that are traditionally specified using octal
> > format.
> >
> > This patch changes Squid3 behavior to match that of Squid2.
> > Internally, Squid3 uses sscanf and Squid2 uses strtol.
> >
> > TODO: Squid3::GetInteger should probably use xatol,
> > and xatol should be fixed to proper verify the result of strtol.
> > modified:
> > src/Parsing.cc parsing.cc-20050103230824-8ncl0k4q72wd-1
> >
> >
> >
> > === modified file 'src/Parsing.cc'
> > --- a/src/Parsing.cc 2007-08-13 23:20:50 +0000
> > +++ b/src/Parsing.cc 2008-04-03 04:41:41 +0000
> > @@ -89,7 +89,8 @@
> > if (token == NULL)
> > self_destruct();
> >
> > - if (sscanf(token, "%d", &i) != 1)
> > + // %i honors 0 and 0x prefixes, which are important for things like umask
> > + if (sscanf(token, "%i", &i) != 1)
> > self_destruct();
> >
> > return i;
> >
> >
Received on Thu Apr 03 2008 - 08:25:04 MDT

This archive was generated by hypermail 2.2.0 : Wed Apr 30 2008 - 12:00:07 MDT