cmd: Display 'set' sort ordering correctly.

This commit is contained in:
Jason Edmeades 2012-09-25 23:16:54 +01:00 committed by Alexandre Julliard
parent a810e41e47
commit cd9451c499
2 changed files with 6 additions and 3 deletions

View File

@ -2234,13 +2234,16 @@ void WCMD_setshow_date (void) {
/**************************************************************************** /****************************************************************************
* WCMD_compare * WCMD_compare
* Note: Native displays 'fred' before 'fred ', so need to only compare up to
* the equals sign.
*/ */
static int WCMD_compare( const void *a, const void *b ) static int WCMD_compare( const void *a, const void *b )
{ {
int r; int r;
const WCHAR * const *str_a = a, * const *str_b = b; const WCHAR * const *str_a = a, * const *str_b = b;
static const WCHAR eqW[] = {'=','\0'};
r = CompareStringW( LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, r = CompareStringW( LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT,
*str_a, -1, *str_b, -1 ); *str_a, strcspnW(*str_a, eqW), *str_b, strcspnW(*str_b, eqW) );
if( r == CSTR_LESS_THAN ) return -1; if( r == CSTR_LESS_THAN ) return -1;
if( r == CSTR_GREATER_THAN ) return 1; if( r == CSTR_GREATER_THAN ) return 1;
return 0; return 0;

View File

@ -235,8 +235,8 @@ FOOBAR = baz
baz2 baz2
0 0
bar bar
@todo_wine@FOOBAR= bar FOOBAR= bar
@todo_wine@FOOBAR = baz2 FOOBAR = baz2
FOOBAR = baz2 FOOBAR = baz2
FOOBAR not defined FOOBAR not defined
1 1