]> git.localhorst.tv Git - blank.git/commitdiff
server save path argument without trailing slash
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 18 Nov 2016 14:07:54 +0000 (15:07 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 18 Nov 2016 14:07:54 +0000 (15:07 +0100)
src/app/runtime.cpp

index 75eeec55dd2c3e9c790ad2dfcd510a1c08396ff9..f51a0cd620d48921fa01c9bd1b53070a0a5ed925 100644 (file)
@@ -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);