Re: Rationale for change in behavior of g_strsplit when passed empty string?



On Monday, July 16, 2001, at 05:17  PM, Owen Taylor wrote:

In absence of a clear "right way" we may need to stick to the 1.2
behavior to avoid breaking existing code in tricky ways.

On Monday, July 16, 2001, at 05:17  PM, Havoc Pennington wrote:

Fixing this bug sounds reasonable. However, it isn't clear to me that
the change you describe was intentionally made as part of fixing it.
Any thoughts on which behavior is more useful or more expected?

I have no real preference here, but I think it would be better to not have a change from 1.2 as Owen says. I only noticed this change at all because we have tests in eel that started producing incorrect results.

Finally, using g_strjoin(), g_strsplit() to flatten and unflatten
vectors is fundementally broken since they don't do escaping.

In the cases I'm dealing with, we are using g_strsplit to do elementary parsing of data structures that use a reserved split sequence and have no escaping scheme. For example, chewing apart X font names.

I agree completely that more-serious uses require something better. It's possible that some of the uses of g_strsplit and g_strjoin in eel and nautilus are broken and need some kind of escaping scheme.

    -- Darin




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