Enlarge max. length of PATH variable in programs/cmd/wcmdmain.c

Alexander.Farber at nokia.com Alexander.Farber at nokia.com
Tue Mar 20 11:02:00 CDT 2007


Hello,

the environment variable PATH is wrongly limited to 260 chars (MAX_PATH)
max. length in the WCMD_run_program() in the file
programs/cmd/wcmdmain.c
and if you try to set it to a longer value (for example by running
"set PATH=%PATH%;%PATH%" several times in "wine cmd" then you'll get
"File not found" errors, because the PATH will be reduced to ".")

However according to http://support.microsoft.com/kb/830473 :
"the total length .... cannot contain more than either 2047 
or 8191 characters (as appropriate to your operating system)"

Please kindly accept the attached patch which modifies 2 lines
to fix this issue.

Changelog: 
	cmd: Enlarge max. PATH length to 2047 characters

Regards
Alex

PS: I think   char string[1024]; in the main() should be extended 
    to   char string[2048];   as well! (please see the MS note above)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Enlarge-max.-length-of-PATH-variable-from-MAX_PATH-to-2047-chars.patch
Type: application/octet-stream
Size: 1321 bytes
Desc: 0001-Enlarge-max.-length-of-PATH-variable-from-MAX_PATH-to-2047-chars.patch
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070320/11680b1c/0001-Enlarge-max.-length-of-PATH-variable-from-MAX_PATH-to-2047-chars-0001.obj


More information about the wine-patches mailing list