Mail Archives: djgpp-workers/1999/01/15/16:02:25
--Message-Boundary-25595
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body
I don't know if the bash maintainer is still around or not, but just in
case...
The attached patch fixes the builtin command exec so a search for
'/bin/sh' finds '/bin/sh.exe'.
This is against the source patched by diffs-b9 in bashb9.zip
Mark
---
Mark Elbrecht snowball3 AT usa DOT net
http://members.xoom.com/snowball3/
--Message-Boundary-25595
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Text from file 'bash.dif'
*** execute_cmd.h.bak Mon Feb 10 02:36:56 1997
--- execute_cmd.h Fri Jan 15 14:37:46 1999
***************
*** 33,38 ****
--- 33,39 ----
extern int file_status __P((char *));
extern int executable_file __P((char *));
extern char *find_user_command __P((char *));
+ extern char *find_user_command_exe __P((char *));
extern char *find_path_file __P((char *));
extern char *user_command_matches __P((char *, int, int));
extern int same_file __P((char *, char *, struct stat *, struct stat *));
*** execute_cmd.c.bak Fri Jan 15 14:49:42 1999
--- execute_cmd.c Fri Jan 15 14:37:24 1999
***************
*** 4324,4329 ****
--- 4324,4336 ----
return (find_user_command_internal (name, FS_EXISTS));
}
+ char *
+ find_user_command_exe (name)
+ char *name;
+ {
+ return (find_user_command_internal (name, FS_EXEC_ONLY));
+ }
+
static char *
find_user_command_internal (name, flags)
char *name;
*** builtins\exec.def.bak Mon Feb 10 02:11:22 1997
--- builtins\exec.def Fri Jan 15 14:51:32 1999
***************
*** 57,63 ****
WORD_LIST *list;
{
int exit_value = EXECUTION_FAILURE;
!
maybe_make_export_env ();
/* First, let the redirections remain. */
--- 57,65 ----
WORD_LIST *list;
{
int exit_value = EXECUTION_FAILURE;
! #if defined(USE_DOS)
! char *fixp = NULL;
! #endif
maybe_make_export_env ();
/* First, let the redirections remain. */
***************
*** 96,102 ****
--- 98,116 ----
/* A command with a slash anywhere in its name is not looked up in
the search path. */
if (absolute_program (args[0]))
+ #ifdef __DJGPP__
+ {
+ /* search suffix */
+ fixp = dosutil_expand_path (args[0]);
+ command = find_user_command_exe (fixp);
+ if (command == NULL)
+ command = fixp;
+ else
+ free(fixp);
+ }
+ #else
command = args[0];
+ #endif
else
command = find_user_command (args[0]);
if (!command)
--Message-Boundary-25595--
- Raw text -