From 753f3666aaaa00f6fee041819943a0f60ffd0560 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 19 Mar 2002 12:28:55 +0000 Subject: [PATCH] Sort /HELP output better when using multiple categories. Patch by c0ffee. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2632 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/fe-help.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fe-common/core/fe-help.c b/src/fe-common/core/fe-help.c index fa90473d..c087771b 100644 --- a/src/fe-common/core/fe-help.c +++ b/src/fe-common/core/fe-help.c @@ -31,10 +31,17 @@ static int commands_equal(COMMAND_REC *rec, COMMAND_REC *rec2) { + int i; + if (rec->category == NULL && rec2->category != NULL) return -1; if (rec2->category == NULL && rec->category != NULL) return 1; + if (rec->category != NULL && rec2->category != NULL) { + i = strcmp(rec->category, rec2->category); + if (i != 0) + return i; + } return strcmp(rec->cmd, rec2->cmd); }