Hyphens in folder names break LIST
matthew at mxtelecom.com
Thu May 22 06:20:15 EDT 2008
David Carter wrote:
> On Tue, 20 May 2008, Matthew Hodgson wrote:
>> If I create a hierarchy of folders such as:
>> and try to list the folder hierarchy with something like:
>> 11 LIST "" "test%"
>> I get broken output, where test is listed twice - the second time with a
>> \Noselect flag:
> The problem is that '-' sorts before '.' in ASCII. Try:
> improved_mboxlist_sort: 1
> (You will need to dump and then restore the mboxlist).
Thanks for the response - I'm not sure how I managed to miss the
improved_mboxlist_sort option so spectacularly... on spotting the ASCII
sorting problem, one of my first thoughts was to change the comparator
in order to fudge the ordering of '.'.
Out of interest, do you (or anyone else) understand the mstringdata()
code well enough to see what negative side-effects there might be of
simplifying the partial match suppression logic? It seems that the
function, which actually writes the output of LIST/LSUB commands to the
client, is called with the name of the folder which has matched the
pattern, with a matchlen argument which describes how much of the name
was matched by the pattern before hitting a '%'.
As such, I'd have thought that any expression where name[matchlen] !=
'\0' is by definition a partial match which can be suppressed - and I
don't see why the code bothers to compare the stem of the match with the
stem of the previously matched folder name (which is where the behaviour
then breaks with the default comparator). I'm just wondering if
improved_mboxlist_sort is in fact the correct fix to this problem.
Matthew Hodgson <matthew at mxtelecom.com>
Media & Systems Project Manager
Tel: +44 (0) 845 666 7778
More information about the Info-cyrus