On Sun, 31 Dec 2006 12:18:17 -0800 Drew Bertola <[EMAIL PROTECTED]> 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 apache.webthing.com). 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 http://www.apachetutor.org/