Index: base/command_line.cc |
=================================================================== |
--- base/command_line.cc (revision 66131) |
+++ base/command_line.cc (working copy) |
@@ -54,8 +54,15 @@ |
transform(parameter->begin(), parameter->end(), parameter->begin(), |
tolower); |
} |
-#endif |
+// Trims the quotes from the beginning and end of a path. |
+CommandLine::StringType TrimQuotes(const FilePath::StringType& path) { |
+ if (!path.empty() && path[0] == '"' && path[path.length() - 1] == '"') |
+ return path.substr(1, path.length() - 2); |
+ return path; |
+} |
+#endif // defined(OS_WIN) |
+ |
CommandLine::~CommandLine() { |
} |
@@ -114,9 +121,9 @@ |
CommandLine::CommandLine(const FilePath& program) { |
if (!program.empty()) { |
- program_ = program.value(); |
+ program_ = TrimQuotes(program.value()); |
Evan Martin
2010/11/15 22:21:57
To be clear, if there are quotes here something ha
tommi (sloooow) - chröme
2010/11/15 22:41:23
I think so, yes. However I cleaned up quite a bit
|
// TODO(evanm): proper quoting here. |
- command_line_string_ = L'"' + program.value() + L'"'; |
+ command_line_string_ = L'"' + program_ + L'"'; |
} |
} |