From: Gurusamy Sarathy Date: Thu, 24 Jun 1999 22:39:53 +0000 (+0000) Subject: sanity check to cover the case when perl is installed into the X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1c39adb236b2a53b282c5bb8af25d8436eebf688;p=p5sagit%2Fp5-mst-13.2.git sanity check to cover the case when perl is installed into the X:\ (drive root) p4raw-id: //depot/perl@3548 --- diff --git a/win32/win32.c b/win32/win32.c index 1882108..110da4f 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -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;