From 6b35b45bab4d85378a2c813313811a73bfaeccc4 Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 31 Jan 2015 20:29:57 +0000 Subject: [PATCH] Don't match *default.cfg for default config matching. Only match default.cfg and */default.cfg. Rationale is that someone in Xonotic created a file called binds-default.cfg and didn't know about this magic here, leading to https://gitlab.com/xonotic/xonotic-data.pk3dir/issues/1444 and https://gitlab.com/xonotic/xonotic-data.pk3dir/issues/1448 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12138 d7cf8633-e32d-0410-b094-e92efae38249 --- cmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd.c b/cmd.c index 1e2b915a..13d86e00 100644 --- a/cmd.c +++ b/cmd.c @@ -461,7 +461,9 @@ static void Cmd_Exec(const char *filename) { char *f; size_t filenameLen = strlen(filename); - qboolean isdefaultcfg = filenameLen >= 11 && !strcmp(filename + filenameLen - 11, "default.cfg"); + qboolean isdefaultcfg = + !strcmp(filename, "default.cfg") || + (filenameLen >= 12 && !strcmp(filename + filenameLen - 12, "/default.cfg")); if (!strcmp(filename, "config.cfg")) { -- 2.39.2