From 4070113ef0fef840a0fdd5104c38fb23cd0008eb Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 11 Apr 2013 21:44:30 +0900 Subject: Save options directly specified for download in --save-session This change makes --save-session save only options specified for download, more specifically, options in command-line, -i file and via RPC. The other options from conf file and default values are not saved. This will drastically decrease the size of session file. --- src/option_processing.cc | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'src/option_processing.cc') diff --git a/src/option_processing.cc b/src/option_processing.cc index fac8dd0c..98ea844f 100644 --- a/src/option_processing.cc +++ b/src/option_processing.cc @@ -175,6 +175,20 @@ void showCandidates } // namespace +#ifdef __MINGW32__ +namespace { +void optionNativeToUtf8(Option& op) +{ + for(size_t i = 1, len = option::countOption(); i < len; ++i) { + const Pref* pref = option::i2p(i); + if(op.definedLocal(pref) && !util::isUtf8(op.get(pref))) { + op.put(pref, nativeToUtf8(op.get(pref))); + } + } +} +} // namespace +#endif // __MINGW32__ + void option_processing(Option& op, std::vector& uris, int argc, char* argv[]) { @@ -213,9 +227,8 @@ void option_processing(Option& op, std::vector& uris, exit(error_code::FINISHED); } } - - oparser->parseDefaultValues(op); - + SharedHandle