Conversation
Fully compatible reimplementation in Rust with:
- Byte-for-byte output compatibility with C version
- All format specifiers: %A %a %B %b %d %e %H %N %n %t %Y %X %. %{ %}
- Cargo features: old_immediate_fmt, us_format, kill_bob, praise_bob
- Makefile with UPX compression (147KB vs 67KB C)
Fixes buffer overflow vulnerability in C version where user-controlled
format strings can overflow the fixed 391-byte output buffer.
|
I have no objections against having different language ports, but I fear that their features would all differ and especially with all the options that are coming in with the C version, and personally I'd have made a Haskell port after the new features coming in. I feel like it's up to the people who better understand Rust to maintain that one and then if they decide to disappear, it may be confusing for the C heads here. As far as how far this would get - I would probably be cool with that being a fork perhaps? Would distributions make it a different package? A different version (or suffix version)? I'm not completely against just keeping it in a branch and assigning permissions to the branch, or just keeping it in a separate repo managed by someone else. |
|
It has worked well since 1993, I was just testing - could always just keep it up as a fork. The C version is actually smaller in size and the buffer overflow was fixed! |
Summary
This PR adds a complete Rust port of ddate.
Note: This should ideally be merged into a new
rustbranch rather than master, to keep the Rust implementation separate from the C version. Please consider creating arustbranch and retargeting this PR.old_immediate_fmt(default) - original immediate mode formatkill_bob(default) - X-Day countdown supportus_format- US date format (m-d-y)praise_bob- SubGenius slogansopt-level = "z", LTO, panic=abort, stripFile structure
Building
cargo build --release # Or with UPX compression: make releaseBinary size
Test plan