Date: Wed, 27 Mar 1996 18:17:55 +0200 (IST) From: Eli Zaretskii To: djgpp AT delorie DOT com Subject: Bug in `_is_executable', with a patch Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 #include #include + #include #include #include #include *************** _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))