Re: g_build_path() inconsistency



Owen Taylor <otaylor redhat com> writes:

> Can anybody think of a more concise description of this process?
> As an algorithm it is:
> 
>  1) Set L to be the number of leading copies of the separator in
>     the first non-empty element.
> 
>  2) Set T to be the number of trailing copies of the separator in
>     the last non-empty element.
> 
>  3) Remove all elements that are empty or consist only of copies
>     of the separator.
> 
>  4) Join the remaining elements together, inserting L copies of 
>     the separator before the first element, 1 copy of the separator
>     between each pair of elements, and T copies of the separator
>     after the last element.

This should have had an extra step between 3) and 4)

 3') Strip leading and trailing and trailing copies of the 
     separator from each element.

Regards,
                                        Owen



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