tolerate NULL SITELIB_EXP
Gurusamy Sarathy [Mon, 7 Feb 2000 09:57:46 +0000 (09:57 +0000)]
p4raw-id: //depot/perl@5020

perl.c

diff --git a/perl.c b/perl.c
index 931e592..8c0a297 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -3115,12 +3115,15 @@ S_init_perllib(pTHX)
 
 #ifdef SITELIB_EXP
     {
-       char buf[MAXPATHLEN];
-
-       strcpy(buf,SITELIB_EXP);
-       if (strrchr(buf,'/'))           /* XXX Hack, Configure var needed */
-           *strrchr(buf,'/') = '\0';
-       incpush(buf, TRUE);
+       char *path = SITELIB_EXP;
+
+       if (path) {
+           char buf[1024];
+           strcpy(buf,path);
+           if (strrchr(buf,'/'))       /* XXX Hack, Configure var needed */
+               *strrchr(buf,'/') = '\0';
+           incpush(buf, TRUE);
+       }
     }
 #endif
 #if defined(PERL_VENDORLIB_EXP)