diff options
author | Karl Williamson <khw@cpan.org> | 2018-05-01 14:23:23 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-06-25 07:33:26 -0600 |
commit | 5d4a52b5c68a11bfc97c2e24806993b84a61eade (patch) | |
tree | 32adacfa73add58acad66f7a533957d56bd45d11 /perl.c | |
parent | 6928bedc792ff80f0cb915460a7eacae25fa9bdd (diff) | |
download | perl-5d4a52b5c68a11bfc97c2e24806993b84a61eade.tar.gz |
grok_atoUV: allow non-C strings and document
This changes the internal function grok_atoUV() to not require its input
to be NUL-terminated. That means the existing calls to it must be
changed to set the ending position before calling it, as some did
already.
This function is recommended to use in a couple of pods, but it wasn't
documented in perlintern. This commit does that as well.
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -3351,7 +3351,7 @@ Perl_get_debug_opts(pTHX_ const char **s, bool givehelp) } } else if (isDIGIT(**s)) { - const char* e; + const char* e = *s + strlen(*s); if (grok_atoUV(*s, &uv, &e)) *s = e; for (; isWORDCHAR(**s); (*s)++) ; @@ -3946,6 +3946,7 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch, bool *suidscript) UV uv; /* if find_script() returns, it returns a malloc()-ed value */ scriptname = PL_origfilename = find_script(scriptname, dosearch, NULL, 1); + s = scriptname + strlen(scriptname); if (strBEGINs(scriptname, "/dev/fd/") && isDIGIT(scriptname[8]) |