[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gawk] [PATCH 2/2] Fix plugin load failure on OS/2
From: |
KO Myung-Hun |
Subject: |
[bug-gawk] [PATCH 2/2] Fix plugin load failure on OS/2 |
Date: |
Wed, 11 Oct 2017 22:32:25 +0900 |
OS/2 cannot load DLLs whose base name is longer than 8 characters.
Because of this, libtool limits length of DLL base name up to 8
characters. In Gawk, limits likewise.
---
io.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/io.c b/io.c
index 378b1156..a43348db 100644
--- a/io.c
+++ b/io.c
@@ -2913,6 +2913,25 @@ find_source(const char *src, struct stat *stb, int
*errcode, int is_extlib)
*errcode = 0;
if (src == NULL || *src == '\0')
return NULL;
+#ifdef __EMX__
+ /*
+ * On OS/2, DLLs cannot have base name whose length is longer than
+ * 8 characters. Truncate it.
+ */
+ char drive[_MAX_DRIVE];
+ char dir[_MAX_DIR];
+ char name[_MAX_FNAME];
+ char ext[_MAX_EXT];
+ char os2_src[_MAX_PATH];
+
+ if (is_extlib) {
+ _splitpath(src, drive, dir, name, ext);
+ if (strlen(name) > 8)
+ name[8] = '\0';
+ _makepath(os2_src, drive, dir, name, ext);
+ src = os2_src;
+ }
+#endif
path = do_find_source(src, stb, errcode, pi);
if (path == NULL && is_extlib) {
--
2.13.3
- [bug-gawk] [PATCH 0/2] Fix plugin issues on OS/2, KO Myung-Hun, 2017/10/11
- [bug-gawk] [PATCH 2/2] Fix plugin load failure on OS/2,
KO Myung-Hun <=
- Re: [bug-gawk] [PATCH 2/2] Fix plugin load failure on OS/2, Eli Zaretskii, 2017/10/11
- Re: [bug-gawk] [PATCH 2/2] Fix plugin load failure on OS/2, KO Myung-Hun, 2017/10/12
- Re: [bug-gawk] [PATCH 2/2] Fix plugin load failure on OS/2, Eli Zaretskii, 2017/10/12
- Re: [bug-gawk] [PATCH 2/2] Fix plugin load failure on OS/2, KO Myung-Hun, 2017/10/12
- Re: [bug-gawk] [PATCH 2/2] Fix plugin load failure on OS/2, Andrew J. Schorr, 2017/10/12
- Re: [bug-gawk] [PATCH 2/2] Fix plugin load failure on OS/2, Eli Zaretskii, 2017/10/12
- Re: [bug-gawk] [PATCH 2/2] Fix plugin load failure on OS/2, arnold, 2017/10/12
- Re: [bug-gawk] [PATCH 2/2] Fix plugin load failure on OS/2, KO Myung-Hun, 2017/10/12
- Re: [bug-gawk] [PATCH 2/2] Fix plugin load failure on OS/2, Eli Zaretskii, 2017/10/21
- Re: [bug-gawk] [PATCH 2/2] Fix plugin load failure on OS/2, arnold, 2017/10/21