-#define PERL_NO_GET_CONTEXT
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
/* Else there must be at least one byte present, which is good enough */
}
- return *((char *) SvPV_nolen (data->datasv) + data->next_out++);
+ return *((U8 *) SvPV_nolen (data->datasv) + data->next_out++);
}
int
OP *savestart = PL_main_start;
struct byteloader_state bstate;
struct byteloader_fdata data;
+ int len;
data.next_out = 0;
data.datasv = FILTER_DATA(idx);
bstate.bs_sv = Nullsv;
bstate.bs_iv_overflows = 0;
- byterun(aTHX_ &bstate);
+/* KLUDGE */
+ if (byterun(aTHX_ &bstate)
+ && (len = SvCUR(data.datasv) - (STRLEN)data.next_out))
+ {
+ PerlIO_seek(PL_rsfp, -len, SEEK_CUR);
+ PL_rsfp = NULL;
+ }
+ filter_del(byteloader_filter);
if (PL_in_eval) {
OP *o;
if (!sv)
croak ("Could not allocate ByteLoader buffers");
filter_add(byteloader_filter, sv);
-
-void
-unimport(package="ByteLoader", ...)
- char *package
- PPCODE:
- filter_del(byteloader_filter);