From 2a623adf6ce5a921fc37895d9fa05ef21d3bed04 Mon Sep 17 00:00:00 2001 From: Eugene Yakubovich Date: Tue, 13 Feb 2024 13:56:52 -0800 Subject: [PATCH] Bug fix for when len is missing in the hunk If the length is missing, it's assumed to be 1. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d8d068eb..349a9a2c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -384,7 +384,7 @@ impl PatchedFile { .unwrap(); let source_length = header_info .name("source_length") - .map_or("0", |s| s.as_str()) + .map_or("1", |s| s.as_str()) .parse::() .unwrap(); let target_start = header_info @@ -394,7 +394,7 @@ impl PatchedFile { .unwrap(); let target_length = header_info .name("target_length") - .map_or("0", |s| s.as_str()) + .map_or("1", |s| s.as_str()) .parse::() .unwrap(); let section_header = header_info