From cae5f80698c8c92345ee8176857bc682b50bd04d Mon Sep 17 00:00:00 2001 From: Sude Date: Thu, 23 Aug 2018 21:30:24 +0300 Subject: [PATCH] Allow saving empty option values to config Fixes issues caused by boost program options overriding desired value with default value because it wasn't found in config file. For example using --subdir-extras "" --save-config would erase subdir-extras from config file. Trying to download something would then cause the downloader to use default value for subdir-extras because it wasn't found in config. --- main.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index bc4fd7d..d60fc02 100644 --- a/main.cpp +++ b/main.cpp @@ -660,10 +660,7 @@ int main(int argc, char *argv[]) continue; } - if (!option_value_string.empty()) - { - ofs << option << " = " << option_value_string << std::endl; - } + ofs << option << " = " << option_value_string << std::endl; } ofs.close(); if (!Globals::globalConfig.bRespectUmask)