Review request for 7034570 - java.lang.Runtime.exec(String cmd, String env) can not work properly if SystemRoot not inherited
David.Holmes at oracle.com
Thu Apr 14 23:44:12 UTC 2011
Ulf Zibis said the following on 04/15/11 04:02:
> Oops, SystemRoot could be null theoretically. So forget my comment about
> NUL termination.
> But anyway, should we allow to have get("SystemRoot") !=
> Is it correct to defaultly set the "SystemRoot" variable on non-Windows OS?
This ProcessEnvironment.java is a Windows specific file.
> Why don't we inherit ProcessEnvironment from TreeMap, sorted by
> Then we would not need to sort it later.
> > The environment block is required to be sorted when you call
> CreateProcess() on Windows.
> Shouldn't we handle this OS-dependent? There is no need to sort on
> non-Windows OS, and if, it should be case-sensitive.
> ProcessEnvironment pe;
> pe.put("systemroot", "C:\\WINDOWS");
> String systemroot = pe.get("SYSTEMROOT");
> systemroot would remain null!
> So I ask, if we wouldn't better implement class ProcessEnvironment
> Am 14.04.2011 18:34, schrieb Ulf Zibis:
>> You need not to ensure double NUL termination, because now sb.length()
>> is always > 0.
>> Am 14.04.2011 16:06, schrieb Michael McMahon:
>>> An updated webrev is available for this fix. I'll probably go ahead
>>> with the CCC request for the spec. change anyway.
More information about the core-libs-dev