diff options
author | Douglas Lankshear <doug@lankshear.net> | 1998-03-03 02:46:13 -0800 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-03-04 20:58:21 +0000 |
commit | 26b3385cfa7a4193b7fdcd1e1e62a8894e9d9198 (patch) | |
tree | ccb5a2504c260a749adc205964804bde2aa09326 /win32/dl_win32.xs | |
parent | fbbbcc485c1d03c76a91f998e1e4492c8ad56b38 (diff) | |
download | perl-26b3385cfa7a4193b7fdcd1e1e62a8894e9d9198.tar.gz |
[asperl] added AS patch#10
Message-Id: <01BD4691.963D1670.dougl@ActiveState.com>
Subject: [PATCH]
Here's a patch to win32/dl_win32.xs that is a fix for the lookup of statically
linked modules.
-- Doug
p4raw-id: //depot/asperl@760
Diffstat (limited to 'win32/dl_win32.xs')
-rw-r--r-- | win32/dl_win32.xs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/win32/dl_win32.xs b/win32/dl_win32.xs index a8d10e1aa7..2f330b4e1e 100644 --- a/win32/dl_win32.xs +++ b/win32/dl_win32.xs @@ -41,12 +41,38 @@ dl_private_init(CPERLarg) (void)dl_generic_private_init(THIS); } +/* + This function assumes the list staticlinkmodules + will be formed from package names with '::' replaced + with '/'. Thus Win32::OLE is in the list as Win32/OLE +*/ static int dl_static_linked(char *filename) { char **p; + char* ptr; + static char subStr[] = "/auto/"; + char szBuffer[MAX_PATH]; + + /* change all the '\\' to '/' */ + strcpy(szBuffer, filename); + for(ptr = szBuffer; ptr = strchr(ptr, '\\'); ++ptr) + *ptr = '/'; + + /* delete the file name */ + ptr = strrchr(szBuffer, '/'); + if(ptr != NULL) + *ptr = '\0'; + + /* remove leading lib path */ + ptr = strstr(szBuffer, subStr); + if(ptr != NULL) + ptr += sizeof(subStr)-1; + else + ptr = szBuffer; + for (p = staticlinkmodules; *p;p++) { - if (strstr(filename, *p)) return 1; + if (strstr(ptr, *p)) return 1; }; return 0; } |