Closed
Bug 292469
Opened 20 years ago
Closed 20 years ago
Can't run XULRunner applications from a path with spaces in it
Categories
(Toolkit Graveyard :: XULRunner, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.8beta2
People
(Reporter: mcsmurf, Assigned: darin.moz)
Details
Attachments
(1 file)
1.86 KB,
patch
|
benjamin
:
first-review+
chofmann
:
approval1.8b2+
|
Details | Diff | Splinter Review |
I wanted to start a XULRunner app from scratch, the path to the XULRunner app
had spaces in it, so i used something like this to start it (WinDbg confirms this):
D:\mozilla\tree-main\mozilla\obj-xul\dist\bin\xulrunner.exe -app "D:\my
app\application.ini"
First it finds the app, but after the internal restart of xulrunner it just dumps
"Error: Invalid or missing application data!"
to console. WinDbg told me that XULRunner restarts itself like this:
D:\mozilla\TREE-M~1\mozilla\obj-xul\dist\bin\XULRUN~1.exe -app D:\my
app\application.ini
Note the missing quotes.
If i first start the app from a path without spaces and then move the app to a
path with spaces, everything is fine (i guess because then a profile has already
been created and there is no need to restart XULRunner internally).
Assignee | ||
Comment 1•20 years ago
|
||
It seems like this might be an issue for Firefox as well. Try passing a file
path to Firefox on the command line. It should suffer the same problem.
mkdir test
.\firefox.exe -profile test "c:\my test\file.html"
In firefox with a new profile, I get two tabs: one tries to load "c:\my" and the
other tries to load "test/file.html" as a URL relative to the current directory.
Assignee | ||
Comment 2•20 years ago
|
||
This is likely to be less noticed in Firefox since people rarely pass URLs to
Firefox on the command line, and they even more rarely do so when Firefox needs
to restart itself.
-> me
Assignee: nobody → darin
Reporter | ||
Comment 3•20 years ago
|
||
Confirming, i also see that problem with Firefox. Also i get another strange
problem with FF trunk here, it alerts that D:/my/ cannot be found, if you OK
that you dont get any window, but firefox.exe keeps running in background. I'll
put that issue to another bug.
Assignee | ||
Comment 4•20 years ago
|
||
When creating gRestartArgv, I think we probably want to add quotes around
elements that have spaces in them. It looks like the MS CRT code that generates
__argv and __argc will strip the quotes (see parse_cmdline in stdargv.c). This
may be the right thing to do for argv[0] instead of what is done here:
http://lxr.mozilla.org/seamonkey/source/toolkit/xre/nsAppRunner.cpp#974
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•20 years ago
|
||
Frank: if the patch for this bug fixes that other problem with firefox, then
maybe no need for another bug.
Reporter | ||
Comment 6•20 years ago
|
||
(In reply to comment #5)
> Frank: if the patch for this bug fixes that other problem with firefox, then
> maybe no need for another bug.
That bug also happens if you pass something like D:\nofilehere. But i just saw,
the FF window launches some seconds later (so some delay)...
Assignee | ||
Comment 7•20 years ago
|
||
This seems to do the trick.
Attachment #182289 -
Flags: first-review?(benjamin)
Assignee | ||
Comment 8•20 years ago
|
||
BTW, I decided not to bother with changing the code that makes exePath use the
short path form. I figure that that code works so why tempt fate.
Comment 9•20 years ago
|
||
Comment on attachment 182289 [details] [diff] [review]
v1 patch
I'm really confused as to why this is necessary. If we are relaunching with a
remotely unix-like execv, we shouldn't need the quotes, because we aren't being
passed through the shell escaping mechanisms.
Assignee | ||
Comment 10•20 years ago
|
||
Bsmedberg:
The problem is that microsoft's execv seems to assume that arguments do not have
spaces in them. It's a really broken assumption. Just take a look at the
implementation of execv when you get a chance (included with any copy of visual
studio). It just concatenates the arguments together before calling
CreateProcess! So, without quoting, there is no way to discern argument boundaries.
Fortunately, when constructing __argv, the MS CRT strips double quotes. So, we
can double quote any parameters passed to execv if we want them to appear as
single entries in __argv.
Comment 11•20 years ago
|
||
Comment on attachment 182289 [details] [diff] [review]
v1 patch
Wow, ok. The windows POSIX subsystem isn't as capable as I had thought. Please
add a comment to this hack to indicate why it's necessary, and reference this
bug. Also, we should check with mkaply, since this same hack might be necessary
for OS/2.
Attachment #182289 -
Flags: first-review?(benjamin) → first-review+
Assignee | ||
Comment 12•20 years ago
|
||
Comment on attachment 182289 [details] [diff] [review]
v1 patch
This patch affects Firefox too, but shows up more easily under XULRunner.
Attachment #182289 -
Flags: approval1.8b3?
Attachment #182289 -
Flags: approval1.8b2?
Assignee | ||
Updated•20 years ago
|
Severity: normal → major
Target Milestone: --- → mozilla1.8beta2
Comment 13•20 years ago
|
||
Comment on attachment 182289 [details] [diff] [review]
v1 patch
a=chofmann
Attachment #182289 -
Flags: approval1.8b2? → approval1.8b2+
Assignee | ||
Updated•20 years ago
|
Attachment #182289 -
Flags: approval1.8b3?
Comment 14•20 years ago
|
||
Checked in by darin at 2005-05-17 14:55, resolving.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 15•20 years ago
|
||
BTW: I asked mkaply about OS/2, he said everything is ok there (it only opens
one tab with c:\my test\file.html in it.
Updated•9 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•