瀏覽代碼

Fixed compile error with mingw

Tatsuhiro Tsujikawa 14 年之前
父節點
當前提交
82e5318e35
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/option_processing.cc

+ 4 - 4
src/option_processing.cc

@@ -182,10 +182,10 @@ void option_processing(Option& op, std::vector<std::string>& uris,
     // finaly let's parse and store command-iine options.
     oparser->parse(op, cmdstream);
 #ifdef __MINGW32__
-    for(std::map<std::string, std::string>::iterator i = op.begin();
-        i != op.end(); ++i) {
-      if(!util::isUtf8((*i).second)) {
-        (*i).second = nativeToUtf8((*i).second);
+    for(size_t i = 1, len = option::countOption(); i < len; ++i) {
+      const Pref* pref = option::i2p(i);
+      if(op.defined(pref) && !util::isUtf8(op.get(pref))) {
+        op.put(pref, nativeToUtf8(op.get(pref)));
       }
     }
 #endif // __MINGW32__