[PATCH] Cygwin: build_env: fix off-by-one bug when re-adding PATH

2019-08-07 Thread Michael Haubenwallner
Adding default winvar 'PATH=C:\cygwin64\binZ' to an environment that is already allocated for 'SYSTEMROOT=ZWINDIR=Z', we need to count that trailing (Z)ero as well. Otherwise we trigger this assertion failure: $ /bin/env -i SYSTEMROOT= WINDIR= /bin/env assertion "(s - envblock) <= tl" failed: fil

Re: [PATCH] Cygwin: build_env: fix off-by-one bug when re-adding PATH

2019-08-07 Thread Corinna Vinschen
On Aug 7 10:51, Michael Haubenwallner wrote: > Adding default winvar 'PATH=C:\cygwin64\binZ' to an environment that is > already allocated for 'SYSTEMROOT=ZWINDIR=Z', we need to count that > trailing (Z)ero as well. Otherwise we trigger this assertion failure: > > $ /bin/env -i SYSTEMROOT= WINDI

[PATCH] Cygwin: environ: restore SYSTEMDRIVE if unset

2019-08-07 Thread Michael Haubenwallner
Various registry values do rely on the %SystemDrive% env var to be set. Right now, it is not known to be easily possible to query the value of SYSTEMDRIVE environment variable other than preserving the original environment value even across 'env -i', for use cases like the one in: https://cygwin.co

Re: [PATCH] Cygwin: build_env: fix off-by-one bug when re-adding PATH

2019-08-07 Thread Brian Inglis
On 2019-08-07 02:51, Michael Haubenwallner wrote: > Adding default winvar 'PATH=C:\cygwin64\binZ' to an environment that is > already allocated for 'SYSTEMROOT=ZWINDIR=Z', we need to count that > trailing (Z)ero as well. Otherwise we trigger this assertion failure: > > $ /bin/env -i SYSTEMROOT= W