Subject: | Mangling PATH environment variable containing quotes. |
Date: | Fri, 01 Mar 2013 21:33:15 +0000 |
To: | bug-Perl-Dist-Strawberry [...] rt.cpan.org |
From: | Hayden Clark <perlmail [...] clarkgroup.co.uk> |
Version:
This is perl 5, version 16, subversion 2 (v5.16.2) built for
MSWin32-x86-multi-thread
Steps to reproduce:
SET PATH=foo"bar";baz
<strawberry-root>\perl\bin\perl.exe -e "print $ENV{PATH},\"\n\";"
Expected result:
foo"bar";baz
Actual result:
foo"bar;baz
SET PATH=foo;"bar"baz;
<strawberry-root>\perl\bin\perl.exe -e "print $ENV{PATH},\"\n\";"
Expected:
foo;"bar"baz;
Actual:
foo;bar"baz;
(note that echo %PATH% displays foo;"bar"baz; as expected)
Symptoms:
This causes odd behaviour if the system PATH contains elements with
spaces, enclosed in quotes. Things really go casters-up-mode if the
C:\WINDOWS\system32 entry is /after/ the quoted element. This causes
Strawberry Perl to throw out odd errors as it can't execute standard
system utilities (e.g., in Local.pm, qx(chcp) at line 44).