From: Daniel Karbach Date: Fri, 18 Nov 2016 14:07:54 +0000 (+0100) Subject: server save path argument without trailing slash X-Git-Url: http://git.localhorst.tv/?p=blank.git;a=commitdiff_plain;h=ca74cd8cdaf25b5ae778bef1dbabad21cea13b2d server save path argument without trailing slash --- diff --git a/src/app/runtime.cpp b/src/app/runtime.cpp index 75eeec5..f51a0cd 100644 --- a/src/app/runtime.cpp +++ b/src/app/runtime.cpp @@ -356,26 +356,26 @@ void Runtime::ReadArgs(int argc, const char *const *argv) { } else { mode = NORMAL; } -} -void Runtime::ReadPreferences() { if (config.env.asset_path.empty()) { config.env.asset_path = default_asset_path(); } else if ( - config.env.asset_path[config.env.asset_path.size() - 1] != '/' && - config.env.asset_path[config.env.asset_path.size() - 1] != '\\' + config.env.asset_path.back() != '/' && + config.env.asset_path.back() != '\\' ) { config.env.asset_path += '/'; } if (config.env.save_path.empty()) { config.env.save_path = default_save_path(); } else if ( - config.env.save_path[config.env.save_path.size() - 1] != '/' && - config.env.save_path[config.env.save_path.size() - 1] != '\\' + config.env.save_path.back() != '/' && + config.env.save_path.back() != '\\' ) { config.env.save_path += '/'; } +} +void Runtime::ReadPreferences() { string prefs_path = config.env.save_path + "prefs.conf"; if (is_file(prefs_path)) { ifstream file(prefs_path);