From 68e0c94dbb6b7bbacc7c38234a4194817dd11d6a Mon Sep 17 00:00:00 2001 From: axel Date: Thu, 23 Feb 2006 03:47:16 +1000 Subject: [PATCH] Do not unescape strings from completion callouts. Why was this done before? darcs-hash:20060222174716-ac50b-218c6896918e5cf8047ea6291a8cde44061d0b57.gz --- complete.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/complete.c b/complete.c index d3de7dd06..da8924a29 100644 --- a/complete.c +++ b/complete.c @@ -1365,7 +1365,7 @@ static void complete_from_args( const wchar_t *str, { array_list_t possible_comp; - int i; +/* int i; */ al_init( &possible_comp ); @@ -1373,7 +1373,17 @@ static void complete_from_args( const wchar_t *str, eval_args( args, &possible_comp ); proc_pop_interactive(); - /* We need to unescape these strings before matching them */ + /* + Completion results where previously unescaped by the + code below. I have no idea why that was done, but I have + not removed this since I'm not sure if this might be + correct, though I can't think of any reason why it + should be. + + If this code is readded - add an explanation of _why_ completion + strings should be escaped! + */ + /* for( i=0; i< al_get_count( &possible_comp ); i++ ) { wchar_t *next = (wchar_t *)al_get( &possible_comp, i ); @@ -1387,6 +1397,7 @@ static void complete_from_args( const wchar_t *str, } else { + al_set( &possible_comp , i, 0 ); debug( 2, L"Could not expand string %ls on line %d of file %s", next, __LINE__, __FILE__ ); } free( next ); @@ -1396,7 +1407,8 @@ static void complete_from_args( const wchar_t *str, debug( 2, L"Got null string on line %d of file %s", __LINE__, __FILE__ ); } } - + */ + copy_strings_with_prefix( comp_out, str, desc, 0, &possible_comp ); al_foreach( &possible_comp, (void (*)(const void *))&free );