From: Michael Poole Date: Mon, 5 Nov 2007 02:42:11 +0000 (+0000) Subject: Fix a few bugs that made LIST work confusingly with T and C qualifiers. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=28e7e71f49568189535affcdb81e06b3adafcd7c Fix a few bugs that made LIST work confusingly with T and C qualifiers. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1840 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index e1f630c..91d249b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-11-04 Michael Poole + + * ircd/m_list.c (param_parse): Reverse comparison direction when + converting from minutes to time_t, and which bound is set (so that + T * ircd/ircd_lexer.l (YY_INPUT): Redefine to use fbgets(). diff --git a/ircd/m_list.c b/ircd/m_list.c index 381c14a..e634caa 100644 --- a/ircd/m_list.c +++ b/ircd/m_list.c @@ -220,8 +220,11 @@ param_parse(struct Client *sptr, const char *param, struct ListingArgs *args, if (*param != ',' && *param != ' ' && *param != '\0') /* check syntax */ return show_usage(sptr); - if (is_time && val < 80000000) /* Toggle UTC/offset */ - val = TStime() - val * 60; + if (is_time && val < 80000000) { + /* Convert age to timestamp and reverse direction */ + val = TStime() - val * 60; + dir = (dir == '>') ? '<' : '>'; + } switch (is_time) { case 0: /* number of users on channel */ @@ -231,18 +234,18 @@ param_parse(struct Client *sptr, const char *param, struct ListingArgs *args, args->min_users = val; break; - case 1: /* channel topic */ + case 1: /* channel creation time */ if (dir == '<') - args->min_topic_time = val; + args->max_time = val; else - args->max_topic_time = val; + args->min_time = val; break; - case 2: /* channel creation time */ + case 2: /* channel topic */ if (dir == '<') - args->min_time = val; + args->max_topic_time = val; else - args->max_time = val; + args->min_topic_time = val; break; } break; @@ -304,7 +307,6 @@ param_parse(struct Client *sptr, const char *param, struct ListingArgs *args, return show_usage(sptr); return LPARAM_CHANNEL; - break; } if (!*param) /* hit end of string? */ @@ -360,7 +362,6 @@ int m_list(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) switch (param_parse(sptr, parv[param], &args, parc == 2)) { case LPARAM_ERROR: /* error encountered, usage already sent, return */ return 0; - break; case LPARAM_CHANNEL: /* show channel instead */ show_channels++;