Re: replace() function

From: Byron C. Darrah <bdarr_at_sse.FU.HAC.COM_at_hypermail-project.org>
Date: Wed, 14 Oct 1998 08:11:25 -0700 (PDT)
Message-Id: <199810141511.IAA04242_at_pepperoni.pizza.hac.com>

> Date: Wed, 14 Oct 1998 10:59:52 +0200 (MET DST)
> From: Daniel Stenberg <Daniel.Stenberg_at_sth.frontec.se>
>
> On Fri, 9 Oct 1998, Byron C. Darrah wrote:
>
> > char *replace(char *string, char *oldpiece, char *newpiece)
> > {
> > int str_index, newstr_index, oldpiece_index, end,
> > new_len, old_len, cpy_len;
> > char *c;
> > static char newstring[MAXLINE];
>
> This is the old -- bad -- way of solving problems like this. Hypermail must
> be cleaned off *ALL* uses of static buffers used in manners like this. I know
> Kent has shouldered the problem to update a lot of the functions for b4, but
> it also requires that the rest of us, as source contributers, follow the new
> way of doing it and start producing more robust and less error prone code.
>
> There is no maximum line length anymore. We cannot assume that the input is
> shorter than MAXLINE and we can certainly not assume that the output is
> shorter than MAXLINE.

Agreed. But since the currently released beta still uses the fixed-size strings, how are we to contribute patches that don't?

I mean, if I offered a patch that included a bunch of extra stuff needed for doing dynamic strings, and it turned out to be different stuff from what Kent is putting into the next release, it might be more work to integrate the patch than if I just stuck to the old way.

Someone just a few messages ago mentioned that it might be nice to plan another beta release so we can get new code into the hands of contributers sooner. Perhaps that is a good idea...

> This is not meant to be personal nor do I want to scare off contributors. I
> just want hypermail to become a superb and stable piece of software.

Understood. I appreciate your comments.

--Byron Received on Wed 14 Oct 1998 05:14:45 PM GMT

This archive was generated by hypermail 2.2.0 : Thu 22 Feb 2007 07:33:50 PM GMT GMT