httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodent of Unusual Size <Ken.C...@Golux.Com>
Subject Re: [PATCH] Config File Line Continuation (take 3)
Date Tue, 03 Mar 1998 00:38:41 GMT
Ralf S. Engelschall wrote:
> 
> In article <19980302151102.52337@deejai.mch.sni.de> you wrote:
> > On Mon, Mar 02, 1998 at 10:10:43AM +0100, Ralf S. Engelschall wrote:
> >> +            if (cp > cbuf && *(cp-1) == LF) {
> >> +                cp--;
> >> +                if (cp > cbuf && *(cp-1) == CR)
> >> +                    cp--;
> >> +                if (cp > cbuf && *(cp-2) == '\\'
> >                                        ^Isn't this a cp[-1]?
> 
> Ops, yes. The correct line should read:
>                     if (cp > cbuf && *(cp-1) == '\\'
> Thank's for the hint. Fixed.

That brings up a good point.  I think I'd rather see the char == byte
assumptions omitted when code is added - things like this are going
to make UNICODE and similar multi-byte charsets perfectly foul to
handle.  (If and when.)

That is, I prefer "cp[-1]" to "*(cp - 1)".  Ben, is a negative index
guaranteed safe for C arrays?

#ken	P-)}

Ken Coar                    <http://Web.Golux.Com/coar/>
Apache Group member         <http://www.apache.org/>
"Apache Server for Dummies" <http://WWW.Dummies.Com/

Mime
View raw message