From 7616e3014218ac90137582e3e1d90081f890af2e Mon Sep 17 00:00:00 2001
From: mazmazz <mar.marcoz@outlook.com>
Date: Thu, 13 Dec 2018 13:17:56 -0500
Subject: [PATCH] Apply srb2home to SAVECONFIG

---
 src/m_misc.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/m_misc.c b/src/m_misc.c
index 603e3de07..6dff4dbe9 100644
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -493,6 +493,7 @@ void M_FirstLoadConfig(void)
 void M_SaveConfig(const char *filename)
 {
 	FILE *f;
+	char *filepath;
 
 	// make sure not to write back the config until it's been correctly loaded
 	if (!gameconfig_loaded)
@@ -507,10 +508,14 @@ void M_SaveConfig(const char *filename)
 			return;
 		}
 
-		f = fopen(filename, "w");
+		// append srb2home to beginning of filename
+		// configfile already has this applied
+		filepath = va(pandf,srb2home, filename);
+
+		f = fopen(filepath, "w");
 		// change it only if valid
 		if (f)
-			strcpy(configfile, filename);
+			strcpy(configfile, filepath);
 		else
 		{
 			CONS_Alert(CONS_ERROR, M_GetText("Couldn't save game config file %s\n"), filename);
-- 
GitLab