(no title)
squeek502 | 3 months ago
C:\> cd /D λ:\
λ:\> cd bar
λ:\bar> cd /D C:\
C:\> echo %=Λ:%
λ:\bar
C:\> cd /D Λ:
λ:\bar>squeek502 | 3 months ago
C:\> cd /D λ:\
λ:\> cd bar
λ:\bar> cd /D C:\
C:\> echo %=Λ:%
λ:\bar
C:\> cd /D Λ:
λ:\bar>
o11c|3 months ago
squeek502|3 months ago
And indeed, it looks like using `=` as a drive letter breaks things in an interesting way:
`cd` exits with error code 1, but the directory change still goes through.With a program that dumps the NULL terminated <key>=<value> lines of the environment block, it looks like it does still modify the environment, but in an unexpected way:
Before `cd /D =:\`, I had a line that looked like this (i.e. the per-drive CWD for C:\ was C:\foo):
After `cd /D =:\`, that was unexpectedly modified to: Funnily enough, that line means that the "working directory" of the C drive is `=:\`, and that actually is acted upon: ---You might also be interested to know that '= in the name of an environment variable' is a more general edge case that is handled inconsistently on more than just Windows: https://github.com/ziglang/zig/issues/23331