sanity check to cover the case when perl is installed into the
Gurusamy Sarathy [Thu, 24 Jun 1999 22:39:53 +0000 (22:39 +0000)]
X:\ (drive root)

p4raw-id: //depot/perl@3548

win32/win32.c

index 1882108..110da4f 100644 (file)
@@ -219,10 +219,13 @@ get_emd_part(char **prev_path, char *trailing_path, ...)
        optr = ptr;
        *ptr = '\0';
        ptr = strrchr(mod_name, '/');
+       /* avoid stripping component if there is no slash,
+        * or it doesn't match ... */
        if (!ptr || stricmp(ptr+1, strip) != 0) {
-           if(!(*strip == '5' && *(ptr+1) == '5'
-                && strncmp(strip, base, 5) == 0
-                && strncmp(ptr+1, base, 5) == 0))
+           /* ... but not if component matches 5.00X* */
+           if (!ptr || !(*strip == '5' && *(ptr+1) == '5'
+                         && strncmp(strip, base, 5) == 0
+                         && strncmp(ptr+1, base, 5) == 0))
            {
                *optr = '/';
                ptr = optr;