Bug or intentional (glib)



Hello,

I recently used glib for programming in C.
(glib 1.2.8)

Great.

But I have a question concerning g_strsplit

Is it intentional that g_strsplit's parameter
has another semantic than the "never use"
strtok ?

What I mean

When I split a string with strtok, i can
put a space and a tab in the delim string
and strtok splits the string:
"\t bla\t\t  blub  "
into the  strings "bla" and "blub"

However g_strsplit interprets IMHO
the delimiter wrong (I've looked into the
source).  When i give a "\t " as delim string
it looks after "\t " in the string
so the example string above would look
like 
"bla\t"
"blub  "
after split.

if this is intentional i would recommend to
rename the delim parameter to "separator"
to avoid confusion with strtok



Regards
Dietmar




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]