Skip to content

ls: Do not crash on unknown format specifier (e.g. +%Y %0) #7802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
drinkcat opened this issue Apr 20, 2025 · 0 comments · Fixed by #7858
Closed

ls: Do not crash on unknown format specifier (e.g. +%Y %0) #7802

drinkcat opened this issue Apr 20, 2025 · 0 comments · Fixed by #7858
Labels

Comments

@drinkcat
Copy link
Contributor

Found this while doing some optimization of ls.

$ ls -l --time-style="+%Y %0"
total 61600
-rw-r--r-- 1 drinkcat drinkcat 50337176 2025 %0 all
...
$ cargo run ls -l --time-style="+%Y %0"
thread 'main' panicked at /home/drinkcat/nobackup/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs:2783:14:
a Display implementation returned an error unexpectedly: Error
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
total 61600

Looks like this is known in #7687 (@tertsdiepraam, @Qelxiros).

So IIUC we just need to wait for the next chrono release and switch to new_lenient: chronotope/chrono#1693 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants