[perl #24506] [PATCH] cannot weaken refs to read only values
[p5sagit/p5-mst-13.2.git] / ext / Cwd / Cwd.xs
index 3f7b93b..4600fef 100644 (file)
@@ -166,7 +166,7 @@ loop:
                rootd = 0;
 
        if (*wbuf) {
-               if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) {
+               if (strlen(resolved) + strlen(wbuf) + (1 - rootd) + 1 > MAXPATHLEN) {
                        errno = ENAMETOOLONG;
                        goto err1;
                }