summaryrefslogtreecommitdiff
path: root/src/cmd_list.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd_list.cpp')
-rw-r--r--src/cmd_list.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd_list.cpp b/src/cmd_list.cpp
index 566055dbe..ed956e7f1 100644
--- a/src/cmd_list.cpp
+++ b/src/cmd_list.cpp
@@ -56,8 +56,11 @@ CmdResult cmd_list::Handle (const char** parameters, int pcnt, userrec *user)
if (too_many || too_few)
continue;
- if ((pcnt && (!match(i->second->name, parameters[0])) || (*i->second->topic && !match(i->second->topic, parameters[0]))))
- continue;
+ if (pcnt)
+ {
+ if (!match(i->second->name, parameters[0]) && !match(i->second->topic, parameters[0]))
+ continue;
+ }
// if the channel is not private/secret, OR the user is on the channel anyway
bool n = i->second->HasUser(user);