From 7e90a5b65465f16a519db6a9fed6638bb46d8e82 Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 13 Aug 2010 18:42:44 +0000 Subject: [PATCH] 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 ::stable-branch::merge=0d12e67fdbdacfd9ffe88db9ae03dc995ae2d7ca --- cmd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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" : ""); -- 2.39.2