From: divverent Date: Fri, 13 Aug 2010 18:42:44 +0000 (+0000) Subject: In the apropos command exclude \n from being filtered by wildcards for alias values... X-Git-Tag: xonotic-v0.1.0preview~230^2~88 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0d12e67fdbdacfd9ffe88db9ae03dc995ae2d7ca;p=xonotic%2Fdarkplaces.git In the apropos command exclude \n from being filtered by wildcards for alias values (an alias value always got a final \n). For example, apropos ? returned a bunch of aliases with empty definitions From: terencehill git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10390 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cmd.c b/cmd.c index 80e810a5..18cb6a13 100644 --- a/cmd.c +++ b/cmd.c @@ -1145,10 +1145,11 @@ static void Cmd_Apropos_f(void) } for (alias = cmd_alias; alias; alias = alias->next) { + // procede here a bit differently as an alias value always got a final \n if (!matchpattern_with_separator(alias->name, partial, true, "", false)) - if (!matchpattern_with_separator(alias->value, partial, true, "", false)) + if (!matchpattern_with_separator(alias->value, partial, true, "\n", false)) // when \n is as separator wildcards don't match it continue; - Con_Printf("alias ^5%s^7: %s", alias->name, alias->value); + Con_Printf("alias ^5%s^7: %s", alias->name, alias->value); // do not print an extra \n count++; } Con_Printf("%i result%s\n\n", count, (count > 1) ? "s" : "");