Przeglądaj źródła

Enhancements

Fix support for Android Termux configuration.
Fix support for OpenWRT SDK compilation.
Optimize codes.
Tindy X 6 lat temu
rodzic
commit
0676f1f4e4
2 zmienionych plików z 6 dodań i 2 usunięć
  1. 1 1
      scripts/config.termux.sh
  2. 5 1
      src/ini_reader.h

+ 1 - 1
scripts/config.termux.sh

@@ -2,7 +2,7 @@
 set -xe
 
 apt update
-apt install git cmake clang
+apt install git cmake clang pkg-config
 apt install libevent libcurl openssl pcre
 
 git clone https://github.com/jbeder/yaml-cpp

+ 5 - 1
src/ini_reader.h

@@ -642,11 +642,15 @@ public:
 
     int RenameSection(std::string oldName, std::string newName)
     {
-        if(!SectionExist(oldName))
+        if(!SectionExist(oldName) || SectionExist(newName))
             return -1;
+        /*
         auto nodeHandler = ini_content.extract(oldName);
         nodeHandler.key() = newName;
         ini_content.insert(std::move(nodeHandler));
+        */
+        ini_content[newName] = std::move(ini_content[oldName]);
+        ini_content.erase(oldName);
         return 0;
     }