changeset 136:7d3ad9529c4c

ini: fix bool getters to provide default vals for bools and ints
author Paper <mrpapersonic@gmail.com>
date Fri, 10 Nov 2023 10:07:01 -0500
parents 0a458cb26ff4
children 69db40272acd
files include/core/ini.h src/core/filesystem.cc
diffstat 2 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/include/core/ini.h	Thu Nov 09 18:01:56 2023 -0500
+++ b/include/core/ini.h	Fri Nov 10 10:07:01 2023 -0500
@@ -42,10 +42,10 @@
 		/* Integer? */
 		if constexpr (std::is_same<T, bool>::value) {
 			/* Boolean? */
-			return Strings::ToBool(val);
+			return Strings::ToBool(val, def);
 		} else {
 			/* Always fall back to long long */
-			return Strings::ToInt<T>(val);
+			return Strings::ToInt<T>(val, def);
 		}
 	} else {
 		return val;
--- a/src/core/filesystem.cc	Thu Nov 09 18:01:56 2023 -0500
+++ b/src/core/filesystem.cc	Fri Nov 10 10:07:01 2023 -0500
@@ -55,7 +55,6 @@
 	else
 		return std::filesystem::path();
 #endif     // !WIN32 && !MACOSX
-	return path / CONFIG_DIR;
 }
 
 std::filesystem::path GetConfigPath() {