summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2009-03-24 16:38:40 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2009-03-24 16:38:40 +0000
commit6bbb5956d74e3e5680db22a51934dd33f45eb81c (patch)
treee1a17fd70aa9ab1b39f2b045e155b10a049d2f9b /gnu/usr.bin
parent2cacdfb27d31327549c0252ed660b854a04faa8f (diff)
s/postion/position/g
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/perl/ext/PerlIO/encoding/encoding.xs38
-rw-r--r--gnu/usr.bin/perl/ext/PerlIO/via/via.pm2
-rw-r--r--gnu/usr.bin/perl/lib/CGI.pm6
3 files changed, 28 insertions, 18 deletions
diff --git a/gnu/usr.bin/perl/ext/PerlIO/encoding/encoding.xs b/gnu/usr.bin/perl/ext/PerlIO/encoding/encoding.xs
index a714a3d6d2f..eee345e521e 100644
--- a/gnu/usr.bin/perl/ext/PerlIO/encoding/encoding.xs
+++ b/gnu/usr.bin/perl/ext/PerlIO/encoding/encoding.xs
@@ -32,7 +32,7 @@
"SUPER::flush.
Note that "flush" is _also_ called for read mode - we still do the
- (back)-translate so that the the base class's "flush" sees the
+ (back)-translate so that the base class's "flush" sees the
correct number of encoded chars for positioning the seek
pointer. (This double translation is the worst performance issue -
particularly with all-perl encode engine.)
@@ -48,6 +48,7 @@ typedef struct {
SV *enc; /* the encoding object */
SV *chk; /* CHECK in Encode methods */
int flags; /* Flags currently just needs lines */
+ int inEncodeCall; /* trap recursive encode calls */
} PerlIOEncode;
#define NEEDS_LINES 1
@@ -113,12 +114,13 @@ PerlIOEncode_pushed(pTHX_ PerlIO * f, const char *mode, SV * arg, PerlIO_funcs *
code = -1;
}
else {
-#ifdef USE_NEW_SEQUENCE
+
+ /* $enc->renew */
PUSHMARK(sp);
XPUSHs(result);
PUTBACK;
- if (call_method("new_sequence",G_SCALAR|G_EVAL) != 1 || SvTRUE(ERRSV)) {
- Perl_warner(aTHX_ packWARN(WARN_IO), "\"%" SVf "\" does not support new_sequence",
+ if (call_method("renew",G_SCALAR|G_EVAL) != 1 || SvTRUE(ERRSV)) {
+ Perl_warner(aTHX_ packWARN(WARN_IO), "\"%" SVf "\" does not support renew method",
arg);
}
else {
@@ -126,7 +128,6 @@ PerlIOEncode_pushed(pTHX_ PerlIO * f, const char *mode, SV * arg, PerlIO_funcs *
result = POPs;
PUTBACK;
}
-#endif
e->enc = newSVsv(result);
PUSHMARK(sp);
XPUSHs(e->enc);
@@ -147,6 +148,7 @@ PerlIOEncode_pushed(pTHX_ PerlIO * f, const char *mode, SV * arg, PerlIO_funcs *
}
e->chk = newSVsv(get_sv("PerlIO::encoding::fallback", 0));
+ e->inEncodeCall = 0;
FREETMPS;
LEAVE;
@@ -255,7 +257,7 @@ PerlIOEncode_fill(pTHX_ PerlIO * f)
STDCHAR *ptr = PerlIO_get_ptr(n);
SSize_t use = (avail >= 0) ? avail : 0;
SV *uni;
- char *s;
+ char *s = Nullch;
STRLEN len = 0;
e->base.ptr = e->base.end = (STDCHAR *) Nullch;
(void) PerlIOEncode_get_base(aTHX_ f);
@@ -308,8 +310,8 @@ PerlIOEncode_fill(pTHX_ PerlIO * f)
}
else {
/* Create a "dummy" SV to represent the available data from layer below */
- if (SvLEN(e->dataSV) && SvPVX(e->dataSV)) {
- Safefree(SvPVX(e->dataSV));
+ if (SvLEN(e->dataSV) && SvPVX_const(e->dataSV)) {
+ Safefree(SvPVX_mutable(e->dataSV));
}
if (use > (SSize_t)e->base.bufsiz) {
if (e->flags & NEEDS_LINES) {
@@ -321,8 +323,8 @@ PerlIOEncode_fill(pTHX_ PerlIO * f)
use = e->base.bufsiz;
}
}
- SvPVX(e->dataSV) = (char *) ptr;
- SvLEN(e->dataSV) = 0; /* Hands off sv.c - it isn't yours */
+ SvPV_set(e->dataSV, (char *) ptr);
+ SvLEN_set(e->dataSV, 0); /* Hands off sv.c - it isn't yours */
SvCUR_set(e->dataSV,use);
SvPOK_only(e->dataSV);
}
@@ -404,6 +406,7 @@ PerlIOEncode_flush(pTHX_ PerlIO * f)
STRLEN len;
SSize_t count = 0;
if ((PerlIOBase(f)->flags & PERLIO_F_WRBUF) && (e->base.ptr > e->base.buf)) {
+ if (e->inEncodeCall) return 0;
/* Write case - encode the buffer and write() to layer below */
PUSHSTACKi(PERLSI_MAGIC);
SPAGAIN;
@@ -416,9 +419,12 @@ PerlIOEncode_flush(pTHX_ PerlIO * f)
XPUSHs(e->bufsv);
XPUSHs(e->chk);
PUTBACK;
+ e->inEncodeCall = 1;
if (call_method("encode", G_SCALAR) != 1) {
+ e->inEncodeCall = 0;
Perl_die(aTHX_ "panic: encode did not return a value");
}
+ e->inEncodeCall = 0;
SPAGAIN;
str = POPs;
PUTBACK;
@@ -453,6 +459,7 @@ PerlIOEncode_flush(pTHX_ PerlIO * f)
}
/* See if there is anything left in the buffer */
if (e->base.ptr < e->base.end) {
+ if (e->inEncodeCall) return 0;
/* Bother - have unread data.
re-encode and unread() to layer below
*/
@@ -462,8 +469,8 @@ PerlIOEncode_flush(pTHX_ PerlIO * f)
SAVETMPS;
str = sv_newmortal();
sv_upgrade(str, SVt_PV);
- SvPVX(str) = (char*)e->base.ptr;
- SvLEN(str) = 0;
+ SvPV_set(str, (char*)e->base.ptr);
+ SvLEN_set(str, 0);
SvCUR_set(str, e->base.end - e->base.ptr);
SvPOK_only(str);
SvUTF8_on(str);
@@ -472,9 +479,12 @@ PerlIOEncode_flush(pTHX_ PerlIO * f)
XPUSHs(str);
XPUSHs(e->chk);
PUTBACK;
+ e->inEncodeCall = 1;
if (call_method("encode", G_SCALAR) != 1) {
- Perl_die(aTHX_ "panic: encode did not return a value");
+ e->inEncodeCall = 0;
+ Perl_die(aTHX_ "panic: encode did not return a value");
}
+ e->inEncodeCall = 0;
SPAGAIN;
str = POPs;
PUTBACK;
@@ -527,7 +537,7 @@ Off_t
PerlIOEncode_tell(pTHX_ PerlIO * f)
{
PerlIOBuf *b = PerlIOSelf(f, PerlIOBuf);
- /* Unfortunately the only way to get a postion is to (re-)translate,
+ /* Unfortunately the only way to get a position is to (re-)translate,
the UTF8 we have in bufefr and then ask layer below
*/
PerlIO_flush(f);
diff --git a/gnu/usr.bin/perl/ext/PerlIO/via/via.pm b/gnu/usr.bin/perl/ext/PerlIO/via/via.pm
index ce5ea83e046..f76834b3c13 100644
--- a/gnu/usr.bin/perl/ext/PerlIO/via/via.pm
+++ b/gnu/usr.bin/perl/ext/PerlIO/via/via.pm
@@ -150,7 +150,7 @@ in future.
=item $obj->TELL($fh)
-Returns file postion.
+Returns file position.
Optional. Default to be determined.
=item $obj->UNREAD($buffer,$fh)
diff --git a/gnu/usr.bin/perl/lib/CGI.pm b/gnu/usr.bin/perl/lib/CGI.pm
index a27f94b8be7..97b20b892e3 100644
--- a/gnu/usr.bin/perl/lib/CGI.pm
+++ b/gnu/usr.bin/perl/lib/CGI.pm
@@ -18,7 +18,7 @@ use Carp 'croak';
# The most recent version and complete docs are available at:
# http://stein.cshl.org/WWW/software/CGI/
-$CGI::revision = '$Id: CGI.pm,v 1.11 2008/09/29 17:36:08 millert Exp $';
+$CGI::revision = '$Id: CGI.pm,v 1.12 2009/03/24 16:38:39 millert Exp $';
$CGI::VERSION='3.29';
# HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES.
@@ -6002,9 +6002,9 @@ This is the recommended idiom.
For robust code, consider reseting the file handle position to beginning of the
file. Inside of larger frameworks, other code may have already used the query
-object and changed the filehandle postion:
+object and changed the filehandle position:
- seek($fh,0,0); # reset postion to beginning of file.
+ seek($fh,0,0); # reset position to beginning of file.
When a file is uploaded the browser usually sends along some
information along with it in the format of headers. The information