aboutsummaryrefslogtreecommitdiffhomepage
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/util.c b/util.c
index 7c938bf3..1561eb13 100644
--- a/util.c
+++ b/util.c
@@ -923,16 +923,21 @@ int wcsfilecmp( const wchar_t *a, const wchar_t *b )
}
int res = wcsfilecmp( a+1, b+1 );
- switch( abs(res) )
+
+ if( abs(res) < 2 )
{
- case 2:
- return res;
- default:
- if( secondary_diff )
- return secondary_diff>0?1:-1;
+ /*
+ No primary difference in rest of string.
+ Use secondary difference on this element if found.
+ */
+ if( secondary_diff )
+ {
+ return secondary_diff>0?1:-1;
+ }
}
- return 0;
-
+
+ return res;
+
}
void sb_init( string_buffer_t * b)