Mail Archives: djgpp/1996/03/27/11:26:19
There is a big in the current version of the library function
`_is_executable'. The bug manifests itself when `access' claims that
files with `.com' and `.bat' extensions aren't executable. To correct,
apply the patch below to src/libc/posix/sys/stat/is_exec.c, compile it
and update the library.
*** posix/sys/stat/is_exec.c~0 Sun Nov 12 23:22:48 1995
--- posix/sys/stat/is_exec.c Tue Mar 26 23:04:52 1996
***************
*** 18,23 ****
--- 18,24 ----
#include <libc/stubs.h>
#include <stdio.h>
#include <string.h>
+ #include <ctype.h>
#include <errno.h>
#include <dpmi.h>
#include <go32.h>
*************** _is_executable(const char *filename, int
*** 182,192 ****
&& strlen(extension) <= ((extension[0]=='.') ? 4 : 3))
{
/* Search the list of extensions in executables[]. */
! char tmp_buf[6];
! tmp_buf[0] = '|';
! strcpy(tmp_buf+1, *extension == '.' ? extension + 1 : extension);
! strcat(tmp_buf, "|");
if (strstr(non_executables, tmp_buf))
return 0;
else if (strstr(executables, tmp_buf))
--- 183,197 ----
&& strlen(extension) <= ((extension[0]=='.') ? 4 : 3))
{
/* Search the list of extensions in executables[]. */
! char tmp_buf[5], *tp = tmp_buf;
! *tp++ = '|';
! if (*extension == '.')
! extension++;
! while (*extension)
! *tp++ = toupper (*extension++);
! *tp++ = '|';
! *tp = '\0';
if (strstr(non_executables, tmp_buf))
return 0;
else if (strstr(executables, tmp_buf))
- Raw text -