Skip to content

Commit

Permalink
ed: k0 is invalid (#921)
Browse files Browse the repository at this point in the history
* Avoid saving address 0 as a "marked address"
* When edMark() was first written I didn't pick up that this usage was not allowed in other versions of ed
  • Loading branch information
mknos authored Jan 18, 2025
1 parent e87a513 commit 8513145
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bin/ed
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ sub edMark {
my $ad = $adrs[1];
$ad = $adrs[0] unless defined $ad;
$ad = $CurrentLineNum unless defined $ad;
return E_ADDRBAD if $ad == 0;
$marks{$c} = $ad;
return;
}
Expand Down

0 comments on commit 8513145

Please sign in to comment.