diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1997-04-18 00:00:00 +0000 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-04-18 00:00:00 +0000 |
commit | 8903cb82b09fb34870c757f52ce481b09be4b606 (patch) | |
tree | 7efa8803eba367f7f28b7667ac864f893e3a983f /pp_sys.c | |
parent | b306bf39bf31f44f4dcbcdf8bc1d3be82f5e6da3 (diff) | |
download | perl-8903cb82b09fb34870c757f52ce481b09be4b606.tar.gz |
[inseparable changes from match from perl-5.003_97f to perl-5.003_97g]
CORE LANGUAGE CHANGES
Subject: Improve sysseek(), remove systell(), fix Opcode
From: Chip Salzenberg <chip@perl.com>
Files: doio.c ext/Opcode/Makefile.PL ext/Opcode/Opcode.pm ext/Opcode/Opcode.xs global.sym keywords.pl opcode.pl pod/perldelta.pod pod/perldiag.pod pod/perlfunc.pod pp_sys.c proto.h t/op/sysio.t toke.c
DOCUMENTATION
Subject: Document {,un}pack changes
Date: Fri, 18 Apr 97 13:49:39 BST
From: Paul Marquess <pmarquess@bfsec.bt.co.uk>
Files: pod/perldelta.pod pod/perldiag.pod
Msg-ID: 9704181249.AA11733@claudius.bfsec.bt.co.uk
(applied based on p5p patch as commit 7f505e5d2748dc2677688b22967678392a186b16)
OTHER CORE CHANGES
Subject: SECURITY FIX: 'Identifier too long'
From: Chip Salzenberg <chip@perl.com>
Files: pod/perldelta.pod pod/perldiag.pod toke.c
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -155,6 +155,9 @@ static int dooneliner _((char *cmd, char *filename)); #endif /* no flock() */ +#define ZBTLEN 10 +static char zero_but_true[ZBTLEN + 1] = "0 but true"; + /* Pushy I/O. */ PP(pp_backtick) @@ -1357,11 +1360,6 @@ PP(pp_eof) PP(pp_tell) { - return pp_systell(ARGS); -} - -PP(pp_systell) -{ dSP; dTARGET; GV *gv; @@ -1386,7 +1384,14 @@ PP(pp_sysseek) long offset = POPl; gv = last_in_gv = (GV*)POPs; - PUSHs(boolSV(do_seek(gv, offset, whence))); + if (op->op_type == OP_SEEK) + PUSHs(boolSV(do_seek(gv, offset, whence))); + else { + long n = do_sysseek(gv, offset, whence); + PUSHs((n < 0) ? &sv_undef + : sv_2mortal(n ? newSViv((IV)n) + : newSVpv(zero_but_true, ZBTLEN))); + } RETURN; } @@ -1527,7 +1532,7 @@ PP(pp_ioctl) PUSHi(retval); } else { - PUSHp("0 but true", 10); + PUSHp(zero_but_true, ZBTLEN); } RETURN; } @@ -3459,7 +3464,7 @@ PP(pp_semctl) PUSHi(anum); } else { - PUSHp("0 but true",10); + PUSHp(zero_but_true, ZBTLEN); } RETURN; #else |