From c45e457492306e61da99ad430b6e8fdfd552c38b Mon Sep 17 00:00:00 2001 From: axel Date: Tue, 10 Jan 2006 03:13:59 +1000 Subject: [PATCH] Makecompletion functions work with completion descriptions regardless of if they contain a separator character or not darcs-hash:20060109171359-ac50b-d3fc75cb3263d1f20296e5e81a9f48caf345cd01.gz --- wildcard.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wildcard.c b/wildcard.c index 651dd3704..c008d3ab7 100644 --- a/wildcard.c +++ b/wildcard.c @@ -163,7 +163,15 @@ static int wildcard_complete_internal( const wchar_t *orig, Append generic description to item, if the description exists */ if( desc && wcslen(desc) ) - new = wcsdupcat2( str, desc, (void *)0 ); + { + /* + Check if the description already contains a separator character, if not, prepend it + */ + if( wcschr( desc, COMPLETE_SEP ) ) + new = wcsdupcat2( str, desc, (void *)0 ); + else + new = wcsdupcat2( str, COMPLETE_SEP_STR, desc, (void *)0 ); + } else new = wcsdup( str ); }