diff options
author | Lars Hjemli | 2008-11-29 14:27:35 +0100 |
---|---|---|
committer | Lars Hjemli | 2008-11-29 14:27:35 +0100 |
commit | 54272e60965ec6a98b49cbf67d72a4b1f5adc55b (patch) | |
tree | 183bc1876d0c53b879627bb9fd66f2978d41929e | |
parent | ui-repolist: add support for sorting any column (diff) | |
download | cgit-54272e60965ec6a98b49cbf67d72a4b1f5adc55b.tar.gz cgit-54272e60965ec6a98b49cbf67d72a4b1f5adc55b.zip |
ui-repolist: sort null values last
When sorting on e.g. owner, it's not interesting to get all repos without owner at the top of the list. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-repolist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui-repolist.c b/ui-repolist.c index 0de328b..cf27cb3 100644 --- a/ui-repolist.c +++ b/ui-repolist.c | |||
@@ -116,9 +116,9 @@ static int cmp(const char *s1, const char *s2) | |||
116 | if (s1 && s2) | 116 | if (s1 && s2) |
117 | return strcmp(s1, s2); | 117 | return strcmp(s1, s2); |
118 | if (s1 && !s2) | 118 | if (s1 && !s2) |
119 | return 1; | ||
120 | if (s2 && !s1) | ||
121 | return -1; | 119 | return -1; |
120 | if (s2 && !s1) | ||
121 | return 1; | ||
122 | return 0; | 122 | return 0; |
123 | } | 123 | } |
124 | 124 | ||