summaryrefslogtreecommitdiffstats
path: root/base/command_line.cc
diff options
context:
space:
mode:
authorpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-08 20:46:21 +0000
committerpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-08 20:46:21 +0000
commit5d42633876f05084c16c0d0be13460230af3e3ec (patch)
tree9b76a716492b079348296db355651b9dad64f4d5 /base/command_line.cc
parente860d4df29efebdb22e76e625b0a08d4b507f3e9 (diff)
downloadchromium_src-5d42633876f05084c16c0d0be13460230af3e3ec.zip
chromium_src-5d42633876f05084c16c0d0be13460230af3e3ec.tar.gz
chromium_src-5d42633876f05084c16c0d0be13460230af3e3ec.tar.bz2
fix base test harness to work on mac. fix command_line unit tests to match what windows expects. fix base xcode project to separate building and running unit tests into two targets.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@593 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/command_line.cc')
-rw-r--r--base/command_line.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/base/command_line.cc b/base/command_line.cc
index 6556abd..57d1b12 100644
--- a/base/command_line.cc
+++ b/base/command_line.cc
@@ -55,7 +55,12 @@ using namespace std;
// Since we use a lazy match, make sure that longer versions (like L"--")
// are listed before shorter versions (like L"-") of similar prefixes.
+#if defined(OS_WIN)
const wchar_t* const CommandLine::kSwitchPrefixes[] = {L"--", L"-", L"/"};
+#elif defined(OS_POSIX)
+// POSIX shells don't use slash as a switch since they mark absolute paths
+const wchar_t* const CommandLine::kSwitchPrefixes[] = {L"--", L"-"};
+#endif
const wchar_t CommandLine::kSwitchValueSeparator[] = L"=";
@@ -139,9 +144,8 @@ class CommandLine::Data {
}
#elif defined(OS_POSIX) // Does the actual parsing of the command line.
void Init(int argc, const char* argv[]) {
- if (argc <= 1)
+ if (argc < 1)
return;
-
program_ = base::SysNativeMBToWide(argv[0]);
command_line_string_ = program_;