Skip to content
Snippets Groups Projects
Commit 1d5a47b1 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Merge branch 'dd_area_choosers_split_string_infinite_loop_fix' into 'master'

DD area choosers: Fix for infinite loop issue introduced in the previous commit when doing string splits for a 1-in-a-row character

See merge request !549
parents dd0e146a c4b5feed
No related branches found
No related tags found
1 merge request!549DD area choosers: Fix for infinite loop issue introduced in the previous commit when doing string splits for a 1-in-a-row character
...@@ -21,7 +21,7 @@ function splitStringOnSingleCharByItself(pStr, pSeparatorChar) ...@@ -21,7 +21,7 @@ function splitStringOnSingleCharByItself(pStr, pSeparatorChar)
var strArray = []; var strArray = [];
var startIdx = 0; var startIdx = 0;
var colonIdx = indexOfOneCharByItself(pStr, pSeparatorChar, startIdx); var colonIdx = indexOfOneCharByItself(pStr, pSeparatorChar, startIdx);
while (colonIdx > -1) while (colonIdx > -1 && startIdx < pStr.length)
{ {
strArray.push(pStr.substr(startIdx, colonIdx-startIdx)); strArray.push(pStr.substr(startIdx, colonIdx-startIdx));
startIdx = colonIdx + 1; startIdx = colonIdx + 1;
...@@ -48,6 +48,7 @@ function indexOfOneCharByItself(pStr, pChar, pStartIdx) ...@@ -48,6 +48,7 @@ function indexOfOneCharByItself(pStr, pChar, pStartIdx)
startIdx = pStartIdx; startIdx = pStartIdx;
var foundIdx = -1; var foundIdx = -1;
var lastStrIdx = pStr.length - 1; var lastStrIdx = pStr.length - 1;
for (var i = startIdx; i < pStr.length && foundIdx == -1; ++i) for (var i = startIdx; i < pStr.length && foundIdx == -1; ++i)
{ {
if (pStr[i] == pChar) if (pStr[i] == pChar)
......
...@@ -573,6 +573,9 @@ function DDFileAreaChooser_SelectFileArea(pChooseLib) ...@@ -573,6 +573,9 @@ function DDFileAreaChooser_SelectFileArea(pChooseLib)
menuContinueOn = false; menuContinueOn = false;
selectionLoopContinueOn = false; selectionLoopContinueOn = false;
} }
// The key help line will need to be written again
writeKeyHelpLine = true;
} }
else if ((lastUserInputUpper == "/") || (lastUserInputUpper == CTRL_F)) // Start of find else if ((lastUserInputUpper == "/") || (lastUserInputUpper == CTRL_F)) // Start of find
{ {
...@@ -803,6 +806,9 @@ function DDFileAreaChooser_SelectFileArea(pChooseLib) ...@@ -803,6 +806,9 @@ function DDFileAreaChooser_SelectFileArea(pChooseLib)
else else
chosenLibOrSubdirName = previousChosenLibOrSubdirNames.pop(); chosenLibOrSubdirName = previousChosenLibOrSubdirNames.pop();
} }
// The key help line will need to be written again
writeKeyHelpLine = true;
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment