Skip to content

Commit

Permalink
Fixed bug with ParseFile() inappropriately erroring out when passed a…
Browse files Browse the repository at this point in the history
…n empty String
  • Loading branch information
jfriesne committed Jan 1, 2025
1 parent 7bd772e commit 855a7d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ key: - new feature
a moved-into HashtableIterator not to point to the expected content.
* Fixed CMakeLists.txt not to include minizip.c and miniunz.c in
the compiled muscle library.
* ParseFile() was incorrectly returning B_BAD_ARGUMENT when an
empty String was passed to it. Fixed.

9.44 - Released 12/16/2024
- Added an optional human-readable name field to ReaderWriterMutex.
Expand Down
3 changes: 2 additions & 1 deletion util/MiscUtilityFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ static status_t ParseArgsAux(const String & line, Message * optAddToMsg, Queue<S
}
lastCharWasBackslash = (c == '\\');
}

StringTokenizer tok(tokenizeThis(), STRING_TOKENIZER_DEFAULT_SOFT_SEPARATOR_CHARS); // soft/whitespace separators only
const char * t = tok();
while(t)
Expand Down Expand Up @@ -279,7 +280,7 @@ static status_t ParseFileAux(const String * optInStr, FILE * fpIn, Message * opt
if (optInStr)
{
StringTokenizer tok(optInStr->Cstr(), "\r\n");
return (tok.GetRemainderOfString() != NULL) ? ParseFileAux(&tok, NULL, optAddToMsg, optAddToQueue, NULL, 0, cs) : B_BAD_ARGUMENT;
return (tok.GetRemainderOfString() != NULL) ? ParseFileAux(&tok, NULL, optAddToMsg, optAddToQueue, NULL, 0, cs) : B_NO_ERROR;
}
else
{
Expand Down

0 comments on commit 855a7d3

Please sign in to comment.