From: <ps...@us...> - 2009-09-17 18:40:02
|
Revision: 1629 http://znc.svn.sourceforge.net/znc/?rev=1629&view=rev Author: psychon Date: 2009-09-17 18:39:46 +0000 (Thu, 17 Sep 2009) Log Message: ----------- Use a queue instead of a stack for the list of module paths A queue is a FIFO while a stack is a LIFO. The code which added paths to the list of available paths expected them to be checked in the order they were added, but instead they were checked in reverse order. This meant that one could no longer replace "system modules" with a .so in ~/.znc/modules. Thanks to DarthGandalf for noticing and reporting this. Modified Paths: -------------- trunk/Modules.cpp trunk/Modules.h Modified: trunk/Modules.cpp =================================================================== --- trunk/Modules.cpp 2009-09-14 18:45:07 UTC (rev 1628) +++ trunk/Modules.cpp 2009-09-17 18:39:46 UTC (rev 1629) @@ -934,7 +934,7 @@ ModDirList dirs = GetModDirs(); while (!dirs.empty()) { - Dir.FillByWildcard(dirs.top().first, "*.so"); + Dir.FillByWildcard(dirs.front().first, "*.so"); dirs.pop(); for (a = 0; a < Dir.size(); a++) { @@ -964,8 +964,8 @@ ModDirList dirs = GetModDirs(); while (!dirs.empty()) { - sModPath = dirs.top().first + sMod; - sDataPath = dirs.top().second; + sModPath = dirs.front().first + sMod; + sDataPath = dirs.front().second; dirs.pop(); if (CFile::Exists(sModPath)) { Modified: trunk/Modules.h =================================================================== --- trunk/Modules.h 2009-09-14 18:45:07 UTC (rev 1628) +++ trunk/Modules.h 2009-09-17 18:39:46 UTC (rev 1629) @@ -15,7 +15,7 @@ #include "Utils.h" #include <set> #include <vector> -#include <stack> +#include <queue> using std::vector; using std::set; @@ -471,7 +471,7 @@ CString& sDataPath); // Return a list of <module dir, data dir> pairs for directories in // which modules can be found. - typedef std::stack<std::pair<CString, CString> > ModDirList; + typedef std::queue<std::pair<CString, CString> > ModDirList; static ModDirList GetModDirs(); private: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |