summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/OptionValueFileSpec.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-12-10 19:43:43 +0000
committerGreg Clayton <gclayton@apple.com>2012-12-10 19:43:43 +0000
commitc5e2085629069f44adbc6d193824484a91320843 (patch)
tree00204961ce07066bf85c8bc5489035555a734780 /lldb/source/Interpreter/OptionValueFileSpec.cpp
parent7b5b55c1959284b3938615de8aa71f61bbcb270d (diff)
downloadbcm5719-llvm-c5e2085629069f44adbc6d193824484a91320843.tar.gz
bcm5719-llvm-c5e2085629069f44adbc6d193824484a91320843.zip
<rdar://problem/12827031>
Fix the OptionValueFileSpec option value to correctly get the file path when trailing spaces are on the path. The "settings set" command uses the OptionValueFileSpec class to set file paths and if extra spaces are at the end it will include those in the paths. Now we chop up the value send to to OptionValueFileSpec::SetValueFromCString(...) function with "lldb_private::Args" and give an appropriate error if more than one path is used. It also allows for quotes to be used when specifying the path. llvm-svn: 169753
Diffstat (limited to 'lldb/source/Interpreter/OptionValueFileSpec.cpp')
-rw-r--r--lldb/source/Interpreter/OptionValueFileSpec.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/OptionValueFileSpec.cpp b/lldb/source/Interpreter/OptionValueFileSpec.cpp
index cb1d00c7831..96bc0e0bccc 100644
--- a/lldb/source/Interpreter/OptionValueFileSpec.cpp
+++ b/lldb/source/Interpreter/OptionValueFileSpec.cpp
@@ -94,8 +94,17 @@ OptionValueFileSpec::SetValueFromCString (const char *value_cstr,
case eVarSetOperationAssign:
if (value_cstr && value_cstr[0])
{
- m_value_was_set = true;
- m_current_value.SetFile(value_cstr, value_cstr[0] == '~');
+ Args args(value_cstr);
+ if (args.GetArgumentCount() == 1)
+ {
+ const char *path = args.GetArgumentAtIndex(0);
+ m_value_was_set = true;
+ m_current_value.SetFile(path, true);
+ }
+ else
+ {
+ error.SetErrorString("please supply a single path argument for this file or quote the path if it contains spaces");
+ }
}
else
{
OpenPOWER on IntegriCloud