GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — diff - `--ignore-file-name-case` folds non-ASCII letters in the C locale · Issue #356 · uutils/diffutils Open Labels bugSomething isn't workingSomething isn't workinggnu-compatBehaviour differs from GNUBehaviour differs from GNUgood first issueGood for newcomersGood for newcomersoss-scannerFound by Anthropic's OSS ScannerFound by Anthropic's OSS Scanner DescriptionIn the C/POSIX locale GNU diff only folds ASCII letters when Reproductionmkdir i1 i2; echo a > i1/É; echo a > i2/é Rust (incorrect) $ LC_ALL=C ./target/release/diffutils diff --ignore-file-name-case i1/É i2 # Output: (none) # Exit code: 0 $ LC_ALL=C ./target/release/diffutils diff -r --ignore-file-name-case i1 i2 # Output: (none) # Exit code: 0 GNU (correct) $ LC_ALL=C diff --ignore-file-name-case i1/É i2 diff: 'i2/'$'\303\211': No such file or directory # Exit code: 2 $ LC_ALL=C diff -r --ignore-file-name-case i1 i2 # two "Only in" lines, one per directory # Exit code: 1 Root cause
pub fn fold_file_name_case(name: &OsStr) -> Vec<u8> { match name.to_str() { Some(name) => name.to_lowercase().into_bytes(), None => name.as_encoded_bytes().to_ascii_lowercase(), } } TestAdd to #[test] #[cfg(unix)] fn ignore_file_name_case_is_ascii_only_in_c_locale() -> Result<(), Box<dyn std::error::Error>> { let tmp_dir = tempdir()?; let (d1, d2) = (tmp_dir.path().join("i1"), tmp_dir.path().join("i2")); std::fs::create_dir(&d1)?; std::fs::create_dir(&d2)?; std::fs::write(d1.join("É"), "a\n")?; std::fs::write(d2.join("é"), "a\n")?; let mut cmd = cargo_bin_cmd!("diffutils"); cmd.env("LC_ALL", "C") .arg("diff") .arg("-r") .arg("--ignore-file-name-case") .arg(&d1) .arg(&d2); cmd.assert().code(predicate::eq(1)); Ok(()) } Reported by Anthropic's OSS Scanner (ANT-2026-1ZSWTAHH). Activity
MetadataMetadataAssigneesLabelsbugSomething isn't workingSomething isn't workinggnu-compatBehaviour differs from GNUBehaviour differs from GNUgood first issueGood for newcomersGood for newcomersoss-scannerFound by Anthropic's OSS ScannerFound by Anthropic's OSS Scanner TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |