Closed Bug 442859 Opened 16 years ago Closed 8 years ago

Strip leading and trailing spaces from path environment variables

Categories

(Core :: XPCOM, defect)

x86
OS/2
defect
Not set
minor

Tracking

()

RESOLVED WONTFIX

People

(Reporter: RainerStroebel, Unassigned)

Details

User-Agent:       Mozilla/5.0 (OS/2; U; Warp 4.5; de; rv:1.9) Gecko/2008061521 Firefox/3.0
Build Identifier: Mozilla/5.0 (OS/2; U; Warp 4.5; de; rv:1.9) Gecko/2008061521 Firefox/3.0


Firefox 3.0 OS/2 Port Warning: Path with tailoring blank in value of MOZ_PLUGIN_PATH is not working.



At OS/2 command Interface the Set command delimits the string only by line end CF/LF.

So it is possible to have a value with tailoring blank in value of MOZ_PLUGIN_PATH.


set MOZ_PLUGIN_PATH=s:\root\subdir [CR/LF]

set MOZ_PLUGIN_PATH=s:\root\subdir[CR/LF]


Only the last version of the set command result in Path working with Firefox 3.0 OS/2 port

With "set MOZ_PLUGIN_PATH=s:\root\subdir [CR/LF]" no plugin are found!!



Related Bugs found at bugzilla:

Bug 403533 ? Firefox on OS X Should Respect MOZ_PLUGIN_PATH (or other alternative plugin directory)

https://bugzilla.mozilla.org/show_bug.cgi?id=403533

==========================================================
additional info about the command systax of OS/2 CMD

Please look at syntax / documation of the  of the set statement
at command prompt

   help  set



and please have a look at the test sample CMD:
with MCP2 command processor

=========================================

rem Test CMD File Env. Variabel String Processing
rem
set test-string=String_without_Blank
set test-string
rem
set test-string=String with Blank
set test-string
rem
rem 2 blank before CR/LF - "set test-string= "
rem --> setzt den Wert auf " "
set test-string=
set test-string
rem
rem no blank before CR/LF - "set test-string="
rem --> Entfernt die Variable aus Env...
set test-string=
set test-string

===========================================
generated output  test.cmd > test-output.txt
============================================

[S:\]rem Test CMD File Env. Variabel String Processing

[S:\]rem

[S:\]set test-string=String_without_Blank

[S:\]set test-string
TEST-STRING=String_without_Blank

[S:\]rem

[S:\]set test-string=String with Blank

[S:\]set test-string
TEST-STRING=String with Blank

[S:\]rem

[S:\]rem 2 blank before CR/LF - "set test-string= "

[S:\]rem --> setzt den Wert auf " "

[S:\]set test-string=

[S:\]set test-string
TEST-STRING=

[S:\]rem

[S:\]rem no blank before CR/LF - "set test-string="

[S:\]rem --> Entfernt die Variable aus Env...

[S:\]set test-string=

[S:\]set test-string
TEST-STRING=(null)

=========================================


from the syntax diagram

<string-1> set <string-2>

the delimeter for String-2 is [CRLF]

The delimeter for String-1 is [CRLF] or  "="

==========================================================
directory names in OS/2 does not have tayloring blanks!
===========================================================

Example:

rem
rem test for directory names with tayloring blanks
rem
P:
cd \
rem
md "test-name-with-tyloring-blank "
rem
cd "test-name-with-tyloring-blank "
cd \
rem
cd "test-name-with-tyloring-blank"
cd \
rd "test-name-with-tyloring-blank"
S:


Output of the  example:

[S:\]rem

[S:\]rem test for directory names with tayloring blanks

[S:\]rem

[S:\]P:

[P:\]cd \

[P:\]rem

[P:\]md "test-name-with-tyloring-blank "

[P:\]rem

[P:\]cd "test-name-with-tyloring-blank "

[P:\test-name-with-tyloring-blank]cd \

[P:\]rem

[P:\]cd "test-name-with-tyloring-blank"

[P:\test-name-with-tyloring-blank]cd \

[P:\]rd "test-name-with-tyloring-blank"

[P:\]S: 



example:

[L:\]set test 01=xxx

[L:\]set test 01
TEST 01=xxx

[L:\]

======================================================================





Reproducible: Always

Steps to Reproduce:
1. Rename the standard Plugin directory.
2. md s:\root\subdir
3. copy the default plugin npnulos2.dll to s:\root\subdir
4. Start firefox with 
  set MOZ_PLUGIN_PATH=s:\root\subdir[CR/LF] 
5. about:plugins   should show the defualt plugin

now the test suite is verify and read for the test case :-)

6. Start firefox with set MOZ_PLUGIN_PATH=s:\root\subdir [CR/LF]
   with tayloring blank of the vaule!!!

7. about:plugins

8. result:  no plugins!!  


Actual Results:  
about:pluginsw does not show the default plugin!

Expected Results:  
Tayloring blanks of  MOZ_PLUGIN_PATH  should be truncated,

so the plugin has to be found
Summary: refox 3.0 OS/2 Port Warning: Path with tailoring blank in value of MOZ_PLUGIN_PATH is not working. → Firefox 3.0 OS/2 Port Warning: Path with tailoring blank in value of MOZ_PLUGIN_PATH is not working.
At first I didn't really get what you meant but I think you are taking about _trailing_ blanks. Will take a look at my OS/2 machine if this makes sense.
Summary: Firefox 3.0 OS/2 Port Warning: Path with tailoring blank in value of MOZ_PLUGIN_PATH is not working. → Firefox 3.0 OS/2 Port Warning: Path with trailing blank in value of MOZ_PLUGIN_PATH is not working.
Bug 403533 is completely unrelated, but according to that bug, MOZ_PLUGIN_PATH is also supported on Windows.  In that case, this problem could be cross-platform, as the 'set' command on Win32 will also store trailing blanks, and they are also automatically stripped from directory names.
OK, I tried hard to make a directory with trailing space but didn't succeed. So we have to deal with leading and trailing spaces in directory names. This isn't new with FF3, we never took this into account. Changing the summary to reflect this.

I guess this problem isn't only true for MOZ_PLUGIN_PATH but any environment variable that relates to a directory, like TMP/TEMP/TMPDIR (which also has to be fixed in SQLite). Not really sure yet how to make sure that we find all variables like that. Most of them should be somewhere in xpcom/io, though, like SpecialSystemDirectory.cpp and nsAppFileLocationProvider.cpp.
Status: UNCONFIRMED → NEW
Component: OS Integration → XPCOM
Ever confirmed: true
Product: Firefox → Core
QA Contact: os.integration → xpcom
Summary: Firefox 3.0 OS/2 Port Warning: Path with trailing blank in value of MOZ_PLUGIN_PATH is not working. → Strip leading and trailing spaces from path environment variables
Version: unspecified → Trunk
OS/2 is no longer a supported platform.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.