Skip to content

Commit

Permalink
Merge pull request #401 from mknos/ed-calcline1
Browse files Browse the repository at this point in the history
ed: simplify CalculateLine()
  • Loading branch information
briandfoy authored Jan 5, 2024
2 parents 2797769 + ebe010d commit 7a47926
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions bin/ed
Original file line number Diff line number Diff line change
Expand Up @@ -1044,12 +1044,7 @@ sub CalculateLine {

if (defined($offsetexpr)) {
$myline = $CurrentLineNum unless defined($myline);

if ($offsetdir =~ /^-$/) {
$myline -= $offsetammount;
} else {
$myline += $offsetammount;
}
$myline += int $offsetexpr;
}

if (defined($plusesorminusesexpr)) {
Expand Down

0 comments on commit 7a47926

Please sign in to comment.