Closed Bug 251772 Opened 20 years ago Closed 20 years ago

firefox: line 165: [: too many arguments if spaces in a command line argument

Categories

(Firefox :: Shell Integration, defect)

x86
Linux
defect
Not set
minor

Tracking

()

VERIFIED FIXED

People

(Reporter: tuukka.tolvanen, Assigned: bugs)

Details

(Keywords: fixed-aviary1.0)

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040715 Firefox/0.9.1+
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040715 Firefox/0.9.1+

$ ./firefox -remote 'openURL(about:blank, new-window)'
/home/tt/apps/firefox/firefox-AVIARY-opt_2004-07-15-15Z/firefox/firefox: line
165: [: too many arguments
/home/tt/apps/firefox/firefox-AVIARY-opt_2004-07-15-15Z/firefox/firefox: line
165: [: too many arguments

for i in "$@"; do
	[ $i = ${_optLast} ] && break
	_optOthers="${_optOthers} ${i}"
done #others arg

The $i and ${_optLast} should be quoted. Also, it would seem that any command
line arguments following the first one that is identical to the last one, would
be ignored (for some part of the processing at least).

Reproducible: Always
Steps to Reproduce:
$ ./firefox -remote 'openURL(about:blank, new-window)'
/home/tt/apps/firefox/firefox-AVIARY-opt_2004-07-15-15Z/firefox/firefox: line
165: [: too many arguments
/home/tt/apps/firefox/firefox-AVIARY-opt_2004-07-15-15Z/firefox/firefox: line
165: [: too many arguments

Actual Results:  
errors, but launches ok, -x says things like
+ '[' -remote = 'openURL(about:blank,' 'new-window)' ']'


Expected Results:  
no errors either
Attached patch patch0 (obsolete) — Splinter Review
I guess this is how I'd go about doing what I think it wants to do.
Attachment #153435 - Flags: review?(bryner)
Attachment #153435 - Flags: review?(bryner) → review+
Attached patch patch1Splinter Review
:\ Actually, it looks like all that code ends up doing is set an unused
variable, so I guess just nuking the stuff instead would be better... unless
it's planned for some future use
Attachment #153435 - Attachment is obsolete: true
Attachment #154612 - Flags: review?(bryner)
Attachment #154612 - Flags: review?(bryner) → review+
checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
bryner, do you want to land this for firefox 1.0 as you mentioned in bug 263974
Status: RESOLVED → REOPENED
Flags: blocking-aviary1.0?
Resolution: FIXED → ---
Comment on attachment 154612 [details] [diff] [review]
patch1

a=asa for aviary checkin.
Attachment #154612 - Flags: approval-aviary+
checked into branch, marking fixed.
Status: REOPENED → RESOLVED
Closed: 20 years ago20 years ago
Keywords: fixed-aviary1.0
Resolution: --- → FIXED
tested with 2004102609-0.11 on linux fc2.

1. start firefox: ./firefox &
2. issue remote cmd: ./firefox -remote 'openURL(about:blank, new-window)'

results: another window (about:blank) opens. no errors appear at the cmd line.

is this correct behavior?
> is this correct behavior?

it is.
thanks, Tuukka! vrfy'ing as fixed.
Status: RESOLVED → VERIFIED
Flags: blocking-aviary1.0?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: