httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <>
Subject Re: splitting a string...
Date Mon, 01 Jan 2007 10:24:37 GMT
On Sun, 31 Dec 2006 12:18:17 -0800
Drew Bertola <> wrote:

[ in a thread I seem to be missing the start of ]

> > If str was \0 terminated, you would not need a length. In the above
> > case, you better move the bucket you just read.
> >   
> How can I ensure it's null terminated?

(depends where it's coming from, but probably moot)

> [chop]
> This prints everything up to my head tag, then my required warning
> meta tag is inserted, then everything after my head tag.

If it's markup you're parsing, use a markup parser.  Bearing in mind
that it's a nontrivial wheel to reinvent (your tag may have whitspace
including linebreaks in it, may span more than one bucket or even
brigade, and might also come from a 16-bit character set), you'd be
better advised to use an existing parser.

mod_publisher may be what you need.  Alternatively, see
mod_proxy_html for a simpler HTML-aware output filter.
Or mod_line_edit for non-markup-aware (sed-like) parsing
of arbitrary text (they're all at
Or follow my .sig to where there's a tutorial on filtering
by direct manipulation of buckets.

Nick Kew

Application Development with Apache - the Apache Modules Book

View raw message