Re: patch to change behavior of g_strsplit on empty string back to 1.2 behavior
- From: Joel Becker <jlbec evilplan org>
- To: Darin Adler <darin bentspoon com>
- Cc: Joel Becker <jlbec evilplan org>, Owen Taylor <otaylor redhat com>, gtk-devel-list gnome org
- Subject: Re: patch to change behavior of g_strsplit on empty string back to 1.2 behavior
- Date: Thu, 19 Jul 2001 01:35:44 +0100
On Wed, Jul 18, 2001 at 05:19:34PM -0700, Darin Adler wrote:
> On Wednesday, July 18, 2001, at 05:11 PM, Joel Becker wrote:
>
> > AFAICT, stable behaved like perl. If it doesn't, I'm amazed I
> > haven't seen bugs. I've been using it like perl for the longest time.
>
> Definitely not. I wrote a test program and everything. Stable definitely
> turns g_strsplit("FOO=bar=baz=bletch", "=", 2) into "Foo", "bar",
> "baz=bletch", NULL.
Very, very eek. From glib 1.2.8 glib.h:
/* NULL terminated string arrays.
* g_strsplit() splits up string into max_tokens tokens at delim and
* returns a newly allocated string array.
That means that the returned value will have at most max_tokens
non-NULL elements. This is what I've always gone by wrt behavior. It
is also in CVS glib glib/strfuncs.h.
Ok, testing shows that glib 1.2.8 as well as 1.2.10 have the
max_tokens=2 means 3 behavior. I suspect I now have bugs :-(
Joel
Btw, It would appear that Apple Mail (or your outgoing mailservers)
don't generate Message-IDs. That's so annoying, because being CC'd I
get two copies of the message, with different Message-IDs (gnome.org
and my local spool). Random thought :-)
--
"There is no sincerer love than the love of food."
- George Bernard Shaw
http://www.jlbec.org/
jlbec evilplan org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]