Treat "only" as "yes" instead of "unknown" in YesNoUnknownFromString

Signed-off-by: David Martinez <47610359+dvdmrtnz@users.noreply.github.com>
This commit is contained in:
David Martinez 2024-12-23 11:21:51 +01:00 committed by Konstantin Pastbin
parent 431cf357a3
commit b3a56d8b6c

View file

@ -521,6 +521,7 @@ constexpr char const * kWired = "wired";
constexpr char const * kTerminal = "terminal";
constexpr char const * kYes = "yes";
constexpr char const * kNo = "no";
constexpr char const * kOnly = "only";
string DebugPrint(Internet internet)
{
@ -557,6 +558,8 @@ YesNoUnknown YesNoUnknownFromString(std::string_view str)
{
if (str.empty())
return Unknown;
if (str.find(kOnly) != string::npos)
return Yes;
if (str.find(kYes) != string::npos)
return Yes;
if (str.find(kNo) != string::npos)