Skip to content

Commit

Permalink
ed: w command should not update current filename
Browse files Browse the repository at this point in the history
* When writing a file, w command takes an optional filename argument
* If no filename argument is provided, the "current" filename is used
* If a filename argument is provided, write to that file but don't update the current filename
* Found when testing against GNU and OpenBSD versions
* NB: OpenBSD version calls get_filename() with Save param set to false
  • Loading branch information
mknos authored Jan 20, 2025
1 parent 1ff8462 commit 88a236f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/ed
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ sub edWrite {
$fh = init_pipe($args[0], 1);
return E_OPEN unless $fh;
} else {
$filename = $RememberedFilename = $args[0];
$filename = $args[0];
}
} elsif (defined $RememberedFilename) {
$filename = $RememberedFilename;
Expand Down

0 comments on commit 88a236f

Please sign in to comment.