Skip to content

patch: Crashes if no options between chunks #991

@sciurius

Description

@sciurius

If there is no data between patch chunks, patch will crash.

Easy fix:

*** patch~	2025-07-17 11:34:43.984425703 +0200
--- patch	2025-07-17 11:48:32.880387160 +0200
***************
*** 375,380 ****
--- 375,381 ----
      my $class = "Patch::\u$type";
  
      my ($options, $garbage) = @{$_[0]}{'options', 'garbage'};
+     $options //= [];
  
      # New hunk, same patch.
      $_[0]{hunk}++, return 1 if $_[0]->isa($class) && ! @$garbage;

Metadata

Metadata

Assignees

Labels

Status: releasedthere is a new release with this fixType: bugan existing feature does not work

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions