Skip to content

Commit 88a236f

Browse files
authored
ed: w command should not update current filename
* 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
1 parent 1ff8462 commit 88a236f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/ed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ sub edWrite {
655655
$fh = init_pipe($args[0], 1);
656656
return E_OPEN unless $fh;
657657
} else {
658-
$filename = $RememberedFilename = $args[0];
658+
$filename = $args[0];
659659
}
660660
} elsif (defined $RememberedFilename) {
661661
$filename = $RememberedFilename;

0 commit comments

Comments
 (0)