aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2007-01-03 22:57:02 +1000
committerGravatar axel <axel@liljencrantz.se>2007-01-03 22:57:02 +1000
commit9c23d50e923400ffd8e8efdc54d81352acf415d3 (patch)
tree2555293a5a335ea92a2442a849cf56623922bca8
parent2ec7428e32703b97661898dacd7b065a3f867799 (diff)
Fix bug in completion pager where non-ascii characters where escaped because the locale was set after the completion strings where read in. Thanks to mikeX for the report.
darcs-hash:20070103125702-ac50b-752f6e1182dba4356e068191b52fdb05d3cb5649.gz
-rw-r--r--fish_pager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fish_pager.c b/fish_pager.c
index a82e3927..77434e90 100644
--- a/fish_pager.c
+++ b/fish_pager.c
@@ -916,6 +916,7 @@ static void mangle_completions( array_list_t *l, const wchar_t *prefix )
{
*end = 0;
wchar_t * str = escape( start, 1 );
+
comp->comp_width += my_wcswidth( str );
halloc_register( global_context, str );
al_push( comp->comp, str );
@@ -981,7 +982,6 @@ static void init()
program_name = L"fish_pager";
- wsetlocale( LC_ALL, L"" );
/*
Make fd 1 output to screen, and use some other fd for writing
@@ -1156,6 +1156,7 @@ int main( int argc, char **argv )
else
{
+ wsetlocale( LC_ALL, L"" );
comp = al_halloc( global_context );
prefix = str2wcs( argv[2] );
is_quoted = strcmp( "1", argv[1] )==0;