]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Don't match *default.cfg for default config matching.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 31 Jan 2015 20:29:57 +0000 (20:29 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 31 Jan 2015 20:29:57 +0000 (20:29 +0000)
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

diff --git a/cmd.c b/cmd.c
index 1e2b915a6b07b6bfeddea8b2034404c6f700b715..13d86e00cca360ad64718aa107aed480ac43b553 100644 (file)
--- 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"))
        {