aboutsummaryrefslogtreecommitdiffhomepage
path: root/util.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-10-02 02:02:58 +1000
committerGravatar axel <axel@liljencrantz.se>2006-10-02 02:02:58 +1000
commit15724d079801df9183d0d86cadfbb7dec5b2821b (patch)
treef971d85d58390e28fd4e0429badcca584381709b /util.c
parent2839f5e567e21a15850c3adfa2cc3cd1d7372ea9 (diff)
First stab at multiline editing
darcs-hash:20061001160258-ac50b-1a760913e64b96e30ff321d7fbe4069ca161cdfe.gz
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)