author | Mike Hommey <mh+mozilla@glandium.org> |
Thu, 05 Mar 2015 15:09:33 +0900 | |
changeset 232579 | f1902c4276e1f32ba569c571481d75751edff6b2 |
parent 232578 | d8e71284931bbbb03d81d66fc21f69a3f7fd1dc6 |
child 232580 | 48188cd36ed14bf983e1882b4432c37b492a6e33 |
push id | 56611 |
push user | mh@glandium.org |
push date | Tue, 10 Mar 2015 01:02:34 +0000 |
treeherder | mozilla-inbound@f1902c4276e1 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | bsmedberg |
bugs | 486172, 1080319 |
milestone | 39.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -453,16 +453,18 @@ CheckArg(const char* aArg, bool aCheckOS ) { ++arg; if (*arg == '-') ++arg; if (strimatch(aArg, arg)) { if (aRemArg) RemoveArg(curarg); + else + ++curarg; if (!aParam) { ar = ARG_FOUND; break; } if (*curarg) { if (**curarg == '-' #if defined(XP_WIN) @@ -1627,20 +1629,27 @@ DumpVersion() #ifdef MOZ_ENABLE_XREMOTE static RemoteResult RemoteCommandLine(const char* aDesktopStartupID) { nsresult rv; ArgResult ar; + const char *profile = 0; nsAutoCString program(gAppData->remotingName); ToLowerCase(program); const char *username = getenv("LOGNAME"); + ar = CheckArg("p", false, &profile, false); + if (ar == ARG_BAD) { + PR_fprintf(PR_STDERR, "Error: argument -p requires a profile name\n"); + return REMOTE_ARG_BAD; + } + const char *temp = nullptr; ar = CheckArg("a", true, &temp); if (ar == ARG_BAD) { PR_fprintf(PR_STDERR, "Error: argument -a requires an application name\n"); return REMOTE_ARG_BAD; } else if (ar == ARG_FOUND) { program.Assign(temp); } @@ -1653,17 +1662,17 @@ RemoteCommandLine(const char* aDesktopSt XRemoteClient client; rv = client.Init(); if (NS_FAILED(rv)) return REMOTE_NOT_FOUND; nsXPIDLCString response; bool success = false; - rv = client.SendCommandLine(program.get(), username, nullptr, + rv = client.SendCommandLine(program.get(), username, profile, gArgc, gArgv, aDesktopStartupID, getter_Copies(response), &success); // did the command fail? if (NS_FAILED(rv) || !success) return REMOTE_NOT_FOUND; return REMOTE_FOUND; }