The reason I'm doing this is because it seems that Windows parser looks for an 
odd number of '"' before the escaping, otherwise the escaping character is 
included in the outcome, for example:

string(25) "md "test ^& echo ^%foo^%""  ==> will output a directory called 
"test ^& echo ^%foo^%"

While:
string(31) "md "test "^&" echo "^%"foo"^%""" ==> will output a directory called 
"test & echo %foo%"

(I changed the php code and ran again, these are not the runs of the cmd.exe 
which does the escaping internally).
Which is what I wanted in the first place (and I know it looks ugly...).

Tzachi.

-----Original Message-----
From: Stanislav Malyshev [mailto:[EMAIL PROTECTED] 
Sent: ג 10 יולי 2007 23:51
To: Tzachi Tager
Cc: internals@lists.php.net
Subject: Re: [PHP-DEV] Suggestion for fixing Bug #40928

> /en-us/ntcmds_shelloverview.mspx?mfr=true , quoting: "You can use most
> characters as variable values, including white space. If you use the
> special characters <, >, |, &, or ^, you must precede them with the
> escape character (^) or quotation marks." - So all special characters
> will be replaced with "^<char>".

I think you are not entirely correct here. What the quote means is that 
if you want foo&bar, you should do either "foo&bar" or foo^&bar - not 
replace & with "^&".
-- 
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to