Closed Bug 275434 Opened 20 years ago Closed 20 years ago

Calling Mozilla with "<arguments> -url " tries to load http://1/

Categories

(Core Graveyard :: Cmd-line Features, defect)

x86
OS/2
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 74303

People

(Reporter: mozilla, Unassigned)

Details

This seems to be an OS/2 specific bug. As discussed already in
netscape.public.mozilla.os2 calling Mozilla with arguments like this

   "mozilla.exe -P someprofile -splash -url "

(note the trailing space) causes Mozilla to try to load the URL "1", i.e.
"http://1/". This happens with both the current suite and Firefox (but as the
startup code is in xpfe I don't know how else to file this). Calling Mozilla
like this happens in a program object set up like this (starting Mozilla via Run!):

   Path and file name: <drive+path>\MOZILLA!LE.EXE
   Parameters:         -P Peter -splash -url "%*"
   Working directory:  <drive+path>

The argument "%*" is necessary because this passes URLs and files from the
commandline to Mozilla. If no URL is given the above problematic commandline is
passed to Mozilla.

I am a bit confused by the sources, in that I don't even find the location where
the following arguments are parsed. (For some reason the OS/2 version needs the
extra argument "-url" for passing URLs while other platforms do not seem to
require this.)
Actually, as far as I know, other platforms require the -url as well...

A good place for breakpoints is.

http://lxr.mozilla.org/seamonkey/source/xpfe/components/startup/src/nsCommandLineService.cpp

Thanks for the hint. This is a very strange procedure. If there is a switch
without a value a "1" is appended as its value. So my original command line is
converted to

   mozilla.exe -P someprofile -splash 1 -url 1

I found out that calling Mozilla with a URL in principle works without the
explicit -url switch because the last value without switch is automatically
prepended with -url, so that
   mozilla.exe -P someprofile http://www.mozilla.org
gets
   mozilla.exe -P someprofile -url http://www.mozilla.org

My problem condenses to the fact that if
   mozilla.exe -P someprofile -splash http://www.mozilla.org
is given this is not converted at all so that the URL is ignored because -splash
arguments are not used.

If I rearrange my program object from comment 0 to use
   Parameters:         -splash -P Peter "%*"
everything works perfectly. This, however, is not something that I would expect
as a user, and neither "mozilla -help" nor
<http://www.mozilla.org/docs/command-line-args.html#Syntax_Rules> tell me about
this problem which seems to be cross-platform.
Yep, this is cross platform.

A solution to this would be nice.

*** This bug has been marked as a duplicate of 74303 ***
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
Depends on: 1280106
No longer depends on: 1280106
You need to log in before you can comment on or make changes to this bug.