wip II
[sdk] / ide / src / dialogs / FindInFilesDialog.ec
index 2b7856c..c0f8e0f 100644 (file)
@@ -647,10 +647,11 @@ private:
 
    unsigned int Main()
    {
+      const int stackSize = 1024;
       int frame, treeTop = 0;
       int globalFindCount = 0, filesSearchedCount = 0, filesMatchedCount = 0, dirsMatchedCount = 0;
       //double lastTime = GetTime();
-      SearchStackFrame stack[1024];
+      SearchStackFrame stack[stackSize];
       FindInFilesMode mode = this.mode;
       
       EditBox replaceEdit = null;
@@ -714,7 +715,7 @@ private:
          strcpy(stack[0].path, dir);
          stack[0].fileList = FileListing { dir, extensions = filter.extensions };  // there should be a sorted = true/false 
 
-         for(frame = 0; frame >= 0 && !abort; )
+         for(frame = 0; frame >= 0 && frame < stackSize && !abort; )
          {
             if(stack[frame].fileList.Find())
             {