From: Vincent Pit Date: Sun, 19 Oct 2008 23:15:52 +0000 (+0200) Subject: Brr. Those strstr() really were fugly X-Git-Tag: v0.08~4 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=commitdiff_plain;h=5ad2eeb198dc46b5e4497d3dbb84490d2e5affee Brr. Those strstr() really were fugly --- diff --git a/indirect.xs b/indirect.xs index e144b02..c6e18e7 100644 --- a/indirect.xs +++ b/indirect.xs @@ -183,11 +183,11 @@ STATIC OP *indirect_ck_rv2sv(pTHX_ OP *o) { const char *stash = HvNAME_get(PL_curstash); STRLEN stashlen = HvNAMELEN_get(PL_curstash); - if ((len < stashlen + 2) || name != strstr(name, stash)) { + if ((len < stashlen + 2) || strnNE(name, stash, stashlen)) { /* Failed again ? Try to remove main */ stash = "main"; stashlen = 4; - if ((len < stashlen + 2) || name != strstr(name, stash)) + if ((len < stashlen + 2) || strnNE(name, stash, stashlen)) goto done; } if (name[stashlen] != ':' || name[stashlen+1] != ':')