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
filename - handled incorrectly with inplace editing #13634
Comments
From @nwc10Created by @nwc10The filename - is not handled correctly by in place editing. The semantics commit 85aff57 Some Chip patches (some tweaked to match _5x source): The change in question is this one: As someone (?) recently observed, Perl's magical handling of filenames http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1998-02/msg00419.html The change makes sense. Pretty much every "magical" filename under 2-arg open 1) I don't think that it's worth having super-global-extra-magical exception However, a bug remains. With inplace editing perl is still treating '-' as $ echo 'This is a file' >- Contrast with: $ The fix itself is simple: Inline Patchdiff --git a/doio.c b/doio.c
index e2bfda5..65caa67 100644
--- a/doio.c
+++ b/doio.c
@@ -845,11 +845,6 @@ Perl_nextargv(pTHX_ GV *gv)
Gid_t filegid;
TAINT_PROPER("inplace open");
- if (oldlen == 1 && *PL_oldname == '-') {
- setdefout(gv_fetchpvs("STDOUT", GV_ADD|GV_NOTQUAL,
- SVt_PVIO));
- return IoIFP(GvIOp(gv));
- }
#ifndef FLEXFILENAMES
filedev = PL_statbuf.st_dev;
fileino = PL_statbuf.st_ino;
Nicholas Clark Perl Info
|
This is still mergeable, all we need are tests for this? diff --git a/doio.c b/doio.c
index 9bbf2a4c57..ad1a5a75a2 100644
--- a/doio.c
+++ b/doio.c
@@ -1359,11 +1359,6 @@ Perl_nextargv(pTHX_ GV *gv, bool nomagicopen)
MAGIC *mg;
TAINT_PROPER("inplace open");
- if (oldlen == 1 && *PL_oldname == '-') {
- setdefout(gv_fetchpvs("STDOUT", GV_ADD|GV_NOTQUAL,
- SVt_PVIO));
- return IoIFP(GvIOp(gv));
- }
#ifndef FLEXFILENAMES
filedev = statbuf.st_dev;
fileino = statbuf.st_ino; |
Migrated from rt.perl.org#121358 (status was 'new')
Searchable as RT121358$
The text was updated successfully, but these errors were encountered: