]> git.vpit.fr Git - perl/modules/indirect.git/commitdiff
Brr. Those strstr() really were fugly
authorVincent Pit <vince@profvince.com>
Sun, 19 Oct 2008 23:15:52 +0000 (01:15 +0200)
committerVincent Pit <vince@profvince.com>
Sun, 19 Oct 2008 23:15:52 +0000 (01:15 +0200)
indirect.xs

index e144b02a4febf353155eefc2f432ba7734c5cf4d..c6e18e7204dbde48f30b5bdafebe646e988ad044 100644 (file)
@@ -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);
 
    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;
     /* 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] != ':')
      goto done;
    }
    if (name[stashlen] != ':' || name[stashlen+1] != ':')