[BusyBox-cvs] busybox/shell ash.c, 1.85, 1.86 cmdedit.c, 1.85, 1.86 cmdedit.h, 1.14, 1.15

Glenn McGrath bug1 at busybox.net
Wed Jan 14 09:34:53 UTC 2004


Update of /var/cvs/busybox/shell
In directory nail:/tmp/cvs-serv24935/shell

Modified Files:
	ash.c cmdedit.c cmdedit.h 
Log Message:
Vodz last_patch_122, Check $PATH at runtime to fix tab completion


Index: ash.c
===================================================================
RCS file: /var/cvs/busybox/shell/ash.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- ash.c	13 Jan 2004 10:19:37 -0000	1.85
+++ ash.c	14 Jan 2004 09:34:50 -0000	1.86
@@ -4117,6 +4117,9 @@
 		firstchange = 0;
 	clearcmdentry(firstchange);
 	builtinloc = idx_bltin;
+#ifdef CONFIG_FEATURE_COMMAND_EDITING
+	cmdedit_path_lookup = newval;
+#endif
 }
 
 

Index: cmdedit.c
===================================================================
RCS file: /var/cvs/busybox/shell/cmdedit.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- cmdedit.c	3 Jan 2004 12:07:32 -0000	1.85
+++ cmdedit.c	14 Jan 2004 09:34:51 -0000	1.86
@@ -43,6 +43,8 @@
 
 #include "busybox.h"
 
+#include "../shell/cmdedit.h"
+
 #ifdef CONFIG_LOCALE_SUPPORT
 #define Isprint(c) isprint((c))
 #else
@@ -609,14 +611,20 @@
 	FIND_FILE_ONLY = 2,
 };
 
+#ifdef CONFIG_ASH
+const char *cmdedit_path_lookup;
+#else
+#define cmdedit_path_lookup getenv("PATH")
+#endif
+
 static int path_parse(char ***p, int flags)
 {
 	int npth;
-	char *tmp;
-	char *pth;
+	const char *tmp;
+	const char *pth;
 
 	/* if not setenv PATH variable, to search cur dir "." */
-	if (flags != FIND_EXE_ONLY || (pth = getenv("PATH")) == 0 ||
+	if (flags != FIND_EXE_ONLY || (pth = cmdedit_path_lookup) == 0 ||
 		/* PATH=<empty> or PATH=:<empty> */
 		*pth == 0 || (*pth == ':' && *(pth + 1) == 0)) {
 		return 1;

Index: cmdedit.h
===================================================================
RCS file: /var/cvs/busybox/shell/cmdedit.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- cmdedit.h	9 Dec 2002 11:10:40 -0000	1.14
+++ cmdedit.h	14 Jan 2004 09:34:51 -0000	1.15
@@ -3,6 +3,10 @@
 
 int     cmdedit_read_input(char* promptStr, char* command);
 
+#ifdef CONFIG_ASH
+extern const char *cmdedit_path_lookup;
+#endif
+
 #ifdef CONFIG_FEATURE_COMMAND_SAVEHISTORY
 void    load_history ( const char *fromfile );
 void    save_history ( const char *tofile );




More information about the busybox-cvs mailing list