In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/c9fdc8d6d6015c17bb80025860d54a2632fe0ba2?hp=f2979eac0a03fcba1cd431ef3d46f697176ebcc8>
- Log ----------------------------------------------------------------- commit c9fdc8d6d6015c17bb80025860d54a2632fe0ba2 Author: Daniel Dragan <[email protected]> Date: Mon Jan 5 16:15:37 2015 -0500 remove multi-eval problem from File::Glob get_sv would be called upto 3 times, now it will be called just once ----------------------------------------------------------------------- Summary of changes: ext/File-Glob/Glob.pm | 2 +- ext/File-Glob/Glob.xs | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ext/File-Glob/Glob.pm b/ext/File-Glob/Glob.pm index 2b39dce..de6f72d 100644 --- a/ext/File-Glob/Glob.pm +++ b/ext/File-Glob/Glob.pm @@ -37,7 +37,7 @@ pop @{$EXPORT_TAGS{bsd_glob}}; # no "glob" @EXPORT_OK = (@{$EXPORT_TAGS{'glob'}}, 'csh_glob'); -$VERSION = '1.23'; +$VERSION = '1.24'; sub import { require Exporter; diff --git a/ext/File-Glob/Glob.xs b/ext/File-Glob/Glob.xs index 99d22f6..e0a3681 100644 --- a/ext/File-Glob/Glob.xs +++ b/ext/File-Glob/Glob.xs @@ -153,8 +153,8 @@ csh_glob(pTHX_ AV *entries, const char *pat, STRLEN len, bool is_utf8) const char *s = NULL; const char *piece = NULL; SV *word = NULL; - int const flags = - (int)SvIV(get_sv("File::Glob::DEFAULT_FLAGS", GV_ADD)); + SV *flags_sv = get_sv("File::Glob::DEFAULT_FLAGS", GV_ADD); + int const flags = (int)SvIV(flags_sv); U32 const gimme = GIMME_V; patend = pat + len; @@ -308,8 +308,8 @@ static bool doglob_iter_wrapper(pTHX_ AV *entries, const char *pattern, STRLEN len, bool is_utf8) { dSP; - int const flags = - (int)SvIV(get_sv("File::Glob::DEFAULT_FLAGS", GV_ADD)); + SV * flags_sv = get_sv("File::Glob::DEFAULT_FLAGS", GV_ADD); + int const flags = (int)SvIV(flags_sv); PERL_UNUSED_VAR(len); /* we use \0 termination instead */ /* XXX we currently just use the underlying bytes of the passed SV. @@ -375,7 +375,8 @@ PPCODE: /* remove unsupported flags */ flags &= ~(GLOB_APPEND | GLOB_DOOFFS | GLOB_ALTDIRFUNC | GLOB_MAGCHAR); } else { - flags = (int) SvIV(get_sv("File::Glob::DEFAULT_FLAGS", GV_ADD)); + SV * flags_sv = get_sv("File::Glob::DEFAULT_FLAGS", GV_ADD); + flags = (int)SvIV(flags_sv); } PUTBACK; -- Perl5 Master Repository
