From: Lukas Mai Date: Wed, 20 Jun 2012 08:10:16 +0000 (+0200) Subject: can't strstr but at least use strchr X-Git-Tag: v0.06_01~30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e88490f6d3bc045a2d349da9163211bb4b79b296;p=p5sagit%2FFunction-Parameters.git can't strstr but at least use strchr --- diff --git a/Parameters.xs b/Parameters.xs index 52c0bdb..e9ab948 100644 --- a/Parameters.xs +++ b/Parameters.xs @@ -94,7 +94,12 @@ static int kw_flags(pTHX_ const char *kw_ptr, STRLEN kw_len, Spec *spec) { if (kw_active_len <= kw_len) { return FALSE; } - for (p = kw_active; p < kw_active + kw_active_len - kw_len; p++) { + for ( + p = kw_active; + (p = strchr(p, *kw_ptr)) && + p < kw_active + kw_active_len - kw_len; + p++ + ) { if ( (p == kw_active || p[-1] == ' ') && p[kw_len] == ' ' && @@ -301,7 +306,6 @@ static int parse_fun(pTHX_ OP **pop, const char *keyword_ptr, STRLEN keyword_len sv_catpvs(gen, ")=@_;"); } - /* named sub */ if (saw_name) { /* fprintf(stderr, "! [%.*s]\n", (int)(PL_bufend - PL_bufptr), PL_bufptr); */