Vodz last_patch_122, Check $PATH at runtime to fix tab completion
This commit is contained in:
parent
6a78631164
commit
67285965f3
@ -4117,6 +4117,9 @@ changepath(const char *newval)
|
|||||||
firstchange = 0;
|
firstchange = 0;
|
||||||
clearcmdentry(firstchange);
|
clearcmdentry(firstchange);
|
||||||
builtinloc = idx_bltin;
|
builtinloc = idx_bltin;
|
||||||
|
#ifdef CONFIG_FEATURE_COMMAND_EDITING
|
||||||
|
cmdedit_path_lookup = newval;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,6 +43,8 @@
|
|||||||
|
|
||||||
#include "busybox.h"
|
#include "busybox.h"
|
||||||
|
|
||||||
|
#include "../shell/cmdedit.h"
|
||||||
|
|
||||||
#ifdef CONFIG_LOCALE_SUPPORT
|
#ifdef CONFIG_LOCALE_SUPPORT
|
||||||
#define Isprint(c) isprint((c))
|
#define Isprint(c) isprint((c))
|
||||||
#else
|
#else
|
||||||
@ -609,14 +611,20 @@ enum {
|
|||||||
FIND_FILE_ONLY = 2,
|
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)
|
static int path_parse(char ***p, int flags)
|
||||||
{
|
{
|
||||||
int npth;
|
int npth;
|
||||||
char *tmp;
|
const char *tmp;
|
||||||
char *pth;
|
const char *pth;
|
||||||
|
|
||||||
/* if not setenv PATH variable, to search cur dir "." */
|
/* 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> */
|
/* PATH=<empty> or PATH=:<empty> */
|
||||||
*pth == 0 || (*pth == ':' && *(pth + 1) == 0)) {
|
*pth == 0 || (*pth == ':' && *(pth + 1) == 0)) {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
|
|
||||||
int cmdedit_read_input(char* promptStr, char* command);
|
int cmdedit_read_input(char* promptStr, char* command);
|
||||||
|
|
||||||
|
#ifdef CONFIG_ASH
|
||||||
|
extern const char *cmdedit_path_lookup;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_FEATURE_COMMAND_SAVEHISTORY
|
#ifdef CONFIG_FEATURE_COMMAND_SAVEHISTORY
|
||||||
void load_history ( const char *fromfile );
|
void load_history ( const char *fromfile );
|
||||||
void save_history ( const char *tofile );
|
void save_history ( const char *tofile );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user