| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #731 +/- ##
=======================================
Coverage 91.88% 91.89%
=======================================
Files 35 35
Lines 7233 7240 +7
Branches 376 376
=======================================
+ Hits 6646 6653 +7
Misses 444 444
Partials 143 143 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
Merging this PR will not alter performance✅ 20 untouched benchmarks Comparing leeewee:find-fix-printf-advance-multibyte (7815cf9) with main (3f9926c) |
Sorry, something went wrong.
|
Commit c211220 has test result changes: bfs testsuite: Test results comparison: Current: TOTAL: 314 / PASSED: 267 / FAILED: 41 / SKIPPED: 6 Reference: TOTAL: 314 / PASSED: 267 / FAILED: 41 / SKIPPED: 6 New test failures (2): - gnu/files0_from_ok - gnu/ok_flush Test improvements (2): + gnu/okdir_path_empty + gnu/okdir_path_relative |
Sorry, something went wrong.
|
On windows: failures: ---- find_printf stdout ---- bin: "D:\\a\\findutils\\findutils\\target\\debug\\find.exe" run: D:\a\findutils\findutils\target\debug\find.exe .\test_data\simple -sorted -printf %f %d %h %H %p %P %y bin: "D:\\a\\findutils\\findutils\\target\\debug\\find.exe" run: D:\a\findutils\findutils\target\debug\find.exe a -printf %A+ thread 'find_printf' (8780) panicked at tests\test_find.rs:486:5: Output did not match expected timestamp format note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace |
Sorry, something went wrong.
The find_printf failure is unrelated to this PR — the change here is only in advance_one, a no-op for ASCII, so it can't affect %A+. But digging in, it's a real pre-existing bug: %A+/%C+/%T+ use chrono %.f, which drops the fraction when it isn't full-precision, so e.g. a whole-second timestamp prints …:200 instead of GNU's …:20.0000000000. That's what makes the test flaky on Windows (coarse file times). |
Sorry, something went wrong.
|
I opened #757 to fix the underlying issue — the %A+ fraction wasn't fixed-width, which is what made this test flaky on Windows. |
Sorry, something went wrong.
|
"This branch cannot be rebased due to conflicts" |
Sorry, something went wrong.
advance_one read a full `char` via front() but then dropped it by slicing one byte (`&self.string[1..]`). When that char is multibyte (e.g. a `€` after a `%` conversion, a `\` escape, or a `%A`/`%C`/`%T` time directive), byte index 1 is not a char boundary and the slice panics. Advance by the char's UTF-8 length so multibyte input routes through the normal handling instead of aborting.
|
Commit 7815cf9 has test result changes: bfs testsuite: Test results comparison: Current: TOTAL: 315 / PASSED: 267 / FAILED: 42 / SKIPPED: 6 Reference: TOTAL: 314 / PASSED: 267 / FAILED: 41 / SKIPPED: 6 Changes from main branch: TOTAL: +1 PASSED: +0 FAILED: +1 New test failures (1): - gnu/files0_from_ok |
Sorry, something went wrong.
|
Rebased onto the latest main. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #730
advance_one read a full char via front() but then dropped it by slicing one byte (&self.string[1..]). When that char is multibyte (e.g. € after a % conversion, a \ escape, or a %A/%C/%T time directive), byte index 1 is not a char boundary, so the slice panicked:
(also \€ and %A€ / %C€ / %T€)
This advances by the leading char's UTF-8 length (c.len_utf8()) instead of a fixed 1, so a multibyte char routes through the normal handling instead of aborting — the same multibyte-aware approach #723 applied to peek. Unrecognized escapes / invalid time specifiers keep their existing behavior (a multibyte char now behaves exactly like its ASCII equivalent, e.g. \€ like \q).
Added a regression test (test_parse_multibyte_char_after_directive).