From: divverent Date: Sat, 31 Jan 2015 20:29:57 +0000 (+0000) Subject: Don't match *default.cfg for default config matching. X-Git-Tag: xonotic-v0.8.1~29^2~22 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6b35b45bab4d85378a2c813313811a73bfaeccc4;p=xonotic%2Fdarkplaces.git 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 --- 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")) {