XPFE - nsCommandLineService isn't "reusable"

RESOLVED WONTFIX

Status

()

RESOLVED WONTFIX
13 years ago
10 years ago

People

(Reporter: sergei_d, Unassigned)

Tracking

Trunk
Other
BeOS
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

13 years ago
nsCmdLineService::Initialize(int aArgc, char ** aArgv) method actually "initializes" only mArgc/mArgv
but not
mArgList
and
mArgValueList
http://lxr.mozilla.org/seamonkey/source/xpfe/components/startup/src/nsCommandLineService.cpp#115

It just adds new values to end of lists.

So, if someone decides to use this component to handle "remote/run-time" calls with argc/argv and use same instance of nsCommandLineService - all following service calls (like GetURLToLoad()) will return values based on very first argc/argv.

Wondering if it was comonent author's intention.

Actually, problem could be solved very easy with adding 
mArgList.Clear()
and 
mArgValueList.Clear()
after <a href="http://lxr.mozilla.org/seamonkey/source/xpfe/components/startup/src/nsCommandLineService.cpp#114">line 114</a>.
And i think this is just hot this method should work.
Yeah, everyone can rewrite and double that whole nsCommandLineService functionality for own platform, like Windows and OS/2 do - but is it good thing if we have already such thing implemented?

P.S. Unsure if XP Miscellany is best place, but didn't find more suitable
(Reporter)

Updated

13 years ago
Blocks: 129411

Comment 1

13 years ago
The XPFE commandline service is going away, let's not try to fix this.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → WONTFIX
(Reporter)

Comment 2

13 years ago
benjamin, and what about SM branch?

Comment 3

13 years ago
Which branch? I don't think we want to mess with these interfaces/impls on the 1.8 or 1.8.0 branches.

Updated

10 years ago
Component: XP Miscellany → General
QA Contact: brendan → general
You need to log in before you can comment on or make changes to this bug.