[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
dlltool problem (dot in directory) report and proposed patch
From: |
Pascal Obry |
Subject: |
dlltool problem (dot in directory) report and proposed patch |
Date: |
Thu, 16 Nov 2006 21:46:48 +0100 |
User-agent: |
Thunderbird 1.5 (Windows/20051201) |
There is a problem with dlltool 2.17 (mingw). If a directories in the
installation path contains a dot dlltool will fail. This is because a
bug in pex-win32.c:find_executable(). This routine is checking for an
extension by doing :
int has_extension = !!strchr (program, '.');
Which is obviously wrong if a directory contains a dot. Here is a
changelog and a patch to fix this problem.
* pex-win32.c:
(find_executable): Fix check for file extension. The dot must
come after the last directory separator if any.
*** pex-win32.c.orig Thu Nov 16 21:17:37 2006
--- pex-win32.c Thu Nov 16 21:36:40 2006
***************
*** 404,411 ****
const char *const *ext;
const char *p, *q;
size_t proglen = strlen (program);
! int has_extension = !!strchr (program, '.');
! int has_slash = (strchr (program, '/') || strchr (program, '\\'));
HANDLE h;
if (has_slash)
--- 404,414 ----
const char *const *ext;
const char *p, *q;
size_t proglen = strlen (program);
! int slash_pos = (int) strrchr (program, '/');
! int backslash_pos = (int) strrchr (program, '\\');
! int dot_pos = (int) strrchr (program, '.');
! int has_slash = (slash_pos > backslash_pos) ? slash_pos : backslash_pos;
! int has_extension = !!dot_pos && (dot_pos > has_slash);
HANDLE h;
if (has_slash)
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
- dlltool problem (dot in directory) report and proposed patch,
Pascal Obry <=