diff --git a/include/util/util.hpp b/include/util/util.hpp index 6cb8b57..eeedc0a 100755 --- a/include/util/util.hpp +++ b/include/util/util.hpp @@ -6,6 +6,7 @@ namespace inst::util { void deinitApp (); void initInstallServices(); void deinitInstallServices(); + bool ignoreCaseCompare(const std::string &a, const std::string &b); std::vector getDirectoryFiles(const std::string & dir, const std::vector & extensions); std::vector getDirsAtPath(const std::string & dir); bool removeDirectory(std::string dir); diff --git a/source/netInstall.cpp b/source/netInstall.cpp index 24008b2..0eb6fd7 100755 --- a/source/netInstall.cpp +++ b/source/netInstall.cpp @@ -282,6 +282,7 @@ namespace netInstStuff{ std::string segment; while (std::getline(urlStream, segment, '\n')) urls.push_back(segment); + std::sort(urls.begin(), urls.end(), inst::util::ignoreCaseCompare); break; } diff --git a/source/usbInstall.cpp b/source/usbInstall.cpp index 8e023b6..b96adc3 100755 --- a/source/usbInstall.cpp +++ b/source/usbInstall.cpp @@ -70,9 +70,8 @@ namespace usbInstStuff { // Split the string up into individual title names std::stringstream titleNamesStream(titleListBuf.get()); std::string segment; - while (std::getline(titleNamesStream, segment, '\n')) { - titleNames.push_back(segment); - } + while (std::getline(titleNamesStream, segment, '\n')) titleNames.push_back(segment); + std::sort(titleNames.begin(), titleNames.end(), inst::util::ignoreCaseCompare); return titleNames; }