Hacker Newsnew | past | comments | ask | show | jobs | submit | squeek502's commentslogin

They work just fine, as the drive-specific CWD is stored in the environment as a normally-hidden =<drive-letter>: environment variable which has all the same WTF-16 and case-insensitive properties as drive letters:

    C:\> cd /D λ:\

    λ:\> cd bar

    λ:\bar> cd /D C:\

    C:\> echo %=Λ:%
    λ:\bar

    C:\> cd /D Λ:

    λ:\bar>


Hm, what about using `%` itself?


That would only interact with the shell, as `%` is not actually part of the environment variable name, it's just a way to tell the shell you want it to get the value of an environment variable. The environment block itself is a NULL terminated list of NULL terminated WTF-16 strings of the format <key>=<value>, so `=` would be the more interesting thing to try.

And indeed, it looks like using `=` as a drive letter breaks things in an interesting way:

    =:\> cd bar
    Not enough memory resources are available to process this command.

    =:\bar>
`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):

    =C:=C:\foo
After `cd /D =:\`, that was unexpectedly modified to:

    =C:==:\
Funnily enough, that line means that the "working directory" of the C drive is `=:\`, and that actually is acted upon:

    =:\foo> cd /D C:

    =:\>
---

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


> Any Mods you create for Minecraft: Java Edition from scratch belong to you (including pre-run Mods and in-memory Mods) and you can do whatever you want with them, as long as you don't sell them for money / try to make money from them

https://www.minecraft.net/en-us/eula


Is that legally enforceable? If a mod doesn't contain code / assets from the game itself, what legal rights does Microsoft have over the distribution of that mod?


Yes courts have found that game mods, even if they don't directly include any content from the original game in their distributable, count as derivative works under copyright.

> The ruling continues to apply to the legal status of video game modding, with mods viewed as derivative works that require the consent of the copyright holder. While this may legally limit the creation of mods, machinima, broadcasts, or even cheats, many game developers have authorized and encouraged some of these activities.

https://en.wikipedia.org/wiki/Micro_Star_v%2E_FormGen_Inc%2E


It's copyright infringement by being a derivative work. Maybe. I don't think it's ever been tried in court. They can still blacklist you.



yeah, some jerk filed a windows https bug after the release had been tagged


Good catch, that does indeed look like a mistake in the spec. Everything past the first sentence of that error description is suspect, honestly (seems like it was naively adapted from the example in [1] but that example isn't relevant to the missing-semicolon-after-character-reference error).

Will submit an issue/PR to correct it when I get a chance.

[1] https://html.spec.whatwg.org/multipage/parsing.html#named-ch...


Appreciate it (I'm the author). I'd like to think there's a good bit of interesting stuff in here outside of the specific topic of named character reference tokenization.


"no[t] a 'data structures' person"

says the person who wrote an extremely technical 20k word blog post on data structures! <3


Congratulations on your newfound promotion to data structures person btw


FWIW here's what that looks like for Zig: https://ziglang.org/news/2024-financials/


Super happy about those two :)

Other Foundations are more like the "Penguin Foundation".....



ouch, that perf numbers do hurt


As far as I'm aware, using the self-hosted backend for anything other than Debug mode is a goal, but a far-future goal.

I believe the most relevant links are https://github.com/ziglang/zig/issues/16270 and https://github.com/orgs/ziglang/projects/2/views/1?pane=issu... (as you can see, nothing is concrete yet, just vague mentions of optimization passes)


My understanding is that Zig's incremental compilation will work on a much more granular level (i.e. functions, etc), so, for example, change one function and only that function (and its dependencies) will get recompiled/relinked (there's some linker trickery involved to avoid needing to relink everything IIUC).

More details here: https://ziggit.dev/t/how-zig-incremental-compilation-is-impl...


Why would the function's dependencies need recompilation? I guess the dependees may require it, if they inlined it, or if the signature changed.


I'm probably not describing it fully accurately. See the link for the proper explanation.


Thanks for sharing !


I think everything labeled 'miscompilation' could be fixed without breaking backwards compatibility, since triggering them always leads to an unusable/broken .res file. No clue how likely it is they'll be fixed, though.


You're assuming that anything will notice if the .res file is broken, though. It might add a .res because "that's what Windows programs are supposed to do", or "only old versions of the program actually used that", or "everybody knows it crashes if you use that menu option, so don't use it."

But the build still depends on the compilation of resources succeeding.


For the miscompilations, the fix wouldn't add a new compile error. Instead, rc.exe would just start doing the right thing in certain scenarios, so previously broken things would start working. For example, padding bytes that were previously missing would get properly added.

It's always theoretically possible that someone, somewhere is somehow relying on such a miscompilation, but for many of the ones detailed in the article, it seems extraordinarily unlikely.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: