Skip to content

Commit

Permalink
Merge pull request #178 from mknos/ed-edit-dir
Browse files Browse the repository at this point in the history
ed: raise error for opening a directory
  • Loading branch information
briandfoy committed Jul 5, 2023
2 parents bf05c28 + cd84ffb commit fd943e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/ed
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,11 @@ sub edEdit {

# suck the file into a temp array

if (-d $filename) {
warn "$filename: is a directory\n";
edWarn('cannot read input file');
return 0;
}
unless (open(SOURCE, '<', $filename)) {
edWarn("unable to open $filename: $!");
return 0;
Expand Down

0 comments on commit fd943e5

Please sign in to comment.