diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2015-01-05 16:15:37 -0500 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2015-01-19 10:07:29 +1100 |
commit | c9fdc8d6d6015c17bb80025860d54a2632fe0ba2 (patch) | |
tree | ddeff5d8d40964aaff143fc9bb8b7058cc289d3f /ext/File-Glob | |
parent | f2979eac0a03fcba1cd431ef3d46f697176ebcc8 (diff) | |
download | perl-c9fdc8d6d6015c17bb80025860d54a2632fe0ba2.tar.gz |
remove multi-eval problem from File::Glob
get_sv would be called upto 3 times, now it will be called just once
Diffstat (limited to 'ext/File-Glob')
-rw-r--r-- | ext/File-Glob/Glob.pm | 2 | ||||
-rw-r--r-- | 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 2b39dce6a8..de6f72d7c3 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 99d22f6af3..e0a36814e0 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; |