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

VERIFIED FIXED

Status

()

Firefox
Shell Integration
--
minor
VERIFIED FIXED
14 years ago
12 years ago

People

(Reporter: Tuukka Tolvanen (sp3000), Assigned: Ben Goodger (use ben at mozilla dot org for email))

Tracking

({fixed-aviary1.0})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

1.51 KB, patch
Brian Ryner (not reading)
: review+
Details | Diff | Splinter Review
(Reporter)

Description

14 years ago
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
(Reporter)

Comment 1

14 years ago
Created attachment 153435 [details] [diff] [review]
patch0

I guess this is how I'd go about doing what I think it wants to do.
(Reporter)

Updated

14 years ago
Attachment #153435 - Flags: review?(bryner)
Attachment #153435 - Flags: review?(bryner) → review+
(Reporter)

Comment 2

14 years ago
Created attachment 154612 [details] [diff] [review]
patch1

:\ 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
(Reporter)

Updated

14 years ago
Attachment #153435 - Attachment is obsolete: true
(Reporter)

Updated

14 years ago
Attachment #154612 - Flags: review?(bryner)
Attachment #154612 - Flags: review?(bryner) → review+
checked in.
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED

Comment 4

14 years ago
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 5

14 years ago
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
Last Resolved: 14 years ago14 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?
(Reporter)

Comment 8

14 years ago
> is this correct behavior?

it is.
thanks, Tuukka! vrfy'ing as fixed.
Status: RESOLVED → VERIFIED

Updated

14 years ago
Flags: blocking-aviary1.0?
You need to log in before you can comment on or make changes to this bug.