Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ed: clean some redundant code #437

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions bin/ed
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,8 @@ sub edHelp {
}
if ($toggle) {
$EXTENDED_MESSAGES ^= 1;
return unless $EXTENDED_MESSAGES;
}
if (defined $Error) {
if ($EXTENDED_MESSAGES && defined($Error)) {
print "$Error\n";
}
}
Expand Down Expand Up @@ -475,12 +474,7 @@ sub edMove {
}

my $count = $end - $start + 1;
my @copy;
if ($count == 1) {
push @copy, $lines[$start];
} else {
@copy = @lines[$start .. $end];
}
my @copy = @lines[$start .. $end];
if ($start > $dst && $end > $dst) {
splice(@lines, $start, $count) if $delete;
splice @lines, $dst + 1, 0, @copy;
Expand Down Expand Up @@ -653,9 +647,6 @@ sub edWrite {
$UserHasBeenWarned = 0;
print "$chars\n" unless ($SupressCounts);

# v7 docs say to chmod 666 the file ... we're not going to
# follow the docs *that* closely today (6/16/99 ---gmj)

if ($qflag) {
exit 0;
}
Expand Down
Loading