diff options
author | emaste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
commit | 8037fa4ee916fa20b3c63cbf531f4ee7e1c76138 (patch) | |
tree | 3c2e41c3be19b7fc7666ed45a5f91ec3b6e35f2a /source/Interpreter/OptionValueBoolean.cpp | |
parent | d61b076ede88b56f3372a55e7d1eac6a9d717120 (diff) | |
download | FreeBSD-src-8037fa4ee916fa20b3c63cbf531f4ee7e1c76138.zip FreeBSD-src-8037fa4ee916fa20b3c63cbf531f4ee7e1c76138.tar.gz |
Import LLDB as of upstream SVN 241361 (git 612c075f)
Diffstat (limited to 'source/Interpreter/OptionValueBoolean.cpp')
-rw-r--r-- | source/Interpreter/OptionValueBoolean.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source/Interpreter/OptionValueBoolean.cpp b/source/Interpreter/OptionValueBoolean.cpp index 71cc2af..dae1f4b 100644 --- a/source/Interpreter/OptionValueBoolean.cpp +++ b/source/Interpreter/OptionValueBoolean.cpp @@ -37,7 +37,7 @@ OptionValueBoolean::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, ui } Error -OptionValueBoolean::SetValueFromCString (const char *value_cstr, +OptionValueBoolean::SetValueFromString (llvm::StringRef value_str, VarSetOperationType op) { Error error; @@ -52,7 +52,7 @@ OptionValueBoolean::SetValueFromCString (const char *value_cstr, case eVarSetOperationAssign: { bool success = false; - bool value = Args::StringToBoolean(value_cstr, false, &success); + bool value = Args::StringToBoolean(value_str.str().c_str(), false, &success); if (success) { m_value_was_set = true; @@ -61,12 +61,11 @@ OptionValueBoolean::SetValueFromCString (const char *value_cstr, } else { - if (value_cstr == nullptr) - error.SetErrorString ("invalid boolean string value: NULL"); - else if (value_cstr[0] == '\0') + if (value_str.size() == 0) error.SetErrorString ("invalid boolean string value <empty>"); else - error.SetErrorStringWithFormat ("invalid boolean string value: '%s'", value_cstr); + error.SetErrorStringWithFormat ("invalid boolean string value: '%s'", + value_str.str().c_str()); } } break; @@ -76,7 +75,7 @@ OptionValueBoolean::SetValueFromCString (const char *value_cstr, case eVarSetOperationRemove: case eVarSetOperationAppend: case eVarSetOperationInvalid: - error = OptionValue::SetValueFromCString (value_cstr, op); + error = OptionValue::SetValueFromString (value_str, op); break; } return error; |