Author weeble
Recipients Christophe Simonis, Iztok.Kavkler, ajaksu2, andybuckley, brian.curtin, christian.heimes, edemaine, eric.araujo, giampaolo.rodola, iki, loewis, meatballhat, michael.foord, pitrou, r.david.murray, sandro.tosi, schmir, sfllaw, tarek, tleeuwenburg@gmail.com, tmick, vstinner, weeble, wrstlprmpft
Date 2011-11-28.12:06:07
SpamBayes Score 9.83869e-06
Marked as misclassified No
Message-id <1322481968.62.0.970563141534.issue444582@psf.upfronthosting.co.za>
In-reply-to
Content
I'm not sure what rules are used by Windows to process the PATH string, but I think they are similar to the rules used to parse the command-line into argv in a C/C++ program: http://msdn.microsoft.com/en-us/library/17w5ykft.aspx

I have tested various arrangements of double-quotes in path elements. It appears the quotes can appear anywhere, not just at the start and end of entries. As far as I can tell, *all* they do is toggle the interpretation of the semicolon character between a separator and a character in the directory path. Note in particular: quotes may surround an entire path, segments of a path, fragments of segments of a path, or even may be completely empty. Any number of quotes can appear in a single path entry. There doesn't even need to be an even number of quotes - it seems that an odd number of quotes are treated the same as if a final quote was appended to the very end of the PATH string.

Running my attached test batch file, I see these results:

c:\Users\weeble>pathtest
PATH=
FAIL

PATH=c:\Users\weeble\foo;bar
FAIL

PATH=c:\Users\weeble\"foo;bar"
SUCCESS

PATH="c:\Users\weeble\foo;bar"
SUCCESS

PATH=c:\Users\weeble\"foo;"bar
SUCCESS

PATH=c:\Users\weeble\foo";"bar
SUCCESS

PATH=c:\Users\weeble\""foo";"bar""
SUCCESS

PATH=
FAIL

PATH=c:\Users\weeble\foo";bar
SUCCESS
History
Date User Action Args
2011-11-28 12:06:09weeblesetrecipients: + weeble, loewis, tmick, edemaine, pitrou, vstinner, wrstlprmpft, giampaolo.rodola, christian.heimes, ajaksu2, sfllaw, schmir, tarek, eric.araujo, Christophe Simonis, andybuckley, r.david.murray, tleeuwenburg@gmail.com, michael.foord, brian.curtin, meatballhat, sandro.tosi, iki, Iztok.Kavkler
2011-11-28 12:06:08weeblesetmessageid: <1322481968.62.0.970563141534.issue444582@psf.upfronthosting.co.za>
2011-11-28 12:06:08weeblelinkissue444582 messages
2011-11-28 12:06:07weeblecreate