Skip to content

Commit 8513145

Browse files
authored
ed: k0 is invalid (briandfoy#921)
* 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
1 parent e87a513 commit 8513145

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bin/ed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ sub edMark {
346346
my $ad = $adrs[1];
347347
$ad = $adrs[0] unless defined $ad;
348348
$ad = $CurrentLineNum unless defined $ad;
349+
return E_ADDRBAD if $ad == 0;
349350
$marks{$c} = $ad;
350351
return;
351352
}

0 commit comments

Comments
 (0)