mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
Fix broken sort on printing of variable names in set builtin
darcs-hash:20050920224640-ac50b-cfa316f9a6168e582d3a6057bdda414ce5b56851.gz
This commit is contained in:
parent
8173c736cc
commit
3a60fc5206
1 changed files with 8 additions and 13 deletions
|
@ -229,15 +229,12 @@ static void print_variables(int include_values, int escape, int scope)
|
||||||
|
|
||||||
al_init( &names );
|
al_init( &names );
|
||||||
env_get_names( &names, scope );
|
env_get_names( &names, scope );
|
||||||
names_arr = list_to_char_arr( &names );
|
|
||||||
qsort( names_arr,
|
sort_list( &names );
|
||||||
al_get_count( &names ),
|
|
||||||
sizeof(wchar_t *),
|
|
||||||
(int (*)(const void *, const void *))&wcsfilecmp );
|
|
||||||
|
|
||||||
for( i = 0; i < al_get_count(&names); i++ )
|
for( i = 0; i < al_get_count(&names); i++ )
|
||||||
{
|
{
|
||||||
wchar_t *key = names_arr[i];
|
wchar_t *key = al_get( &names, i );
|
||||||
/* Why does expand_escape free its argument ?! */
|
/* Why does expand_escape free its argument ?! */
|
||||||
wchar_t *e_key = escape ? expand_escape(wcsdup(key), 1) : wcsdup(key);
|
wchar_t *e_key = escape ? expand_escape(wcsdup(key), 1) : wcsdup(key);
|
||||||
sb_append(sb_out, e_key);
|
sb_append(sb_out, e_key);
|
||||||
|
@ -253,9 +250,7 @@ static void print_variables(int include_values, int escape, int scope)
|
||||||
sb_append(sb_out, L"\n");
|
sb_append(sb_out, L"\n");
|
||||||
free(e_key);
|
free(e_key);
|
||||||
}
|
}
|
||||||
|
al_destroy(&names);
|
||||||
free(names_arr);
|
|
||||||
al_destroy(&names);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue