diff --git a/rust/src/fileio_asyncio.rs b/rust/src/fileio_asyncio.rs index 72701e610..726a2becd 100644 --- a/rust/src/fileio_asyncio.rs +++ b/rust/src/fileio_asyncio.rs @@ -3080,13 +3080,11 @@ pub unsafe extern "C" fn FIO_rust_decompressFilename( assert!(!projection.dst_file_name.is_null()); assert!(!projection.src_file_name.is_null()); - if projection.source_is_stdin == 0 { - let source_is_directory = projection - .source_is_directory - .expect("source directory callback is required for named files"); - if unsafe { source_is_directory(projection.opaque, projection.src_file_name) } != 0 { - return 1; - } + let source_is_directory = projection + .source_is_directory + .expect("source directory callback is required"); + if unsafe { source_is_directory(projection.opaque, projection.src_file_name) } != 0 { + return 1; } let open_source = projection @@ -6067,6 +6065,16 @@ mod tests { assert!(state.events.is_empty()); } + #[test] + fn decompress_file_policy_probes_stdin_marker_before_opening_source() { + let mut state = DecompressPolicyState::default(); + let projection = decompress_policy_projection(&mut state, 0, 0, 1, 0, 0); + + assert_eq!(unsafe { FIO_rust_decompressFilename(&projection) }, 0); + assert_eq!(state.source_directory_checks, 1); + assert_eq!(state.events[0], DECOMPRESS_POLICY_OPEN_SOURCE); + } + #[test] fn decompress_file_policy_orders_cleanup_and_successful_source_removal() { let mut state = DecompressPolicyState {