Stop altering PATH to mirror

This commit is contained in:
topjohnwu 2018-08-03 03:38:36 +08:00
parent 5be035fd44
commit cd6918e6eb

View File

@ -115,10 +115,12 @@ static struct node_entry *insert_child(struct node_entry *p, struct node_entry *
***********/
static void set_path(struct vector *v) {
char buffer[512];
for (int i = 0; environ[i]; ++i) {
if (strncmp(environ[i], "PATH=", 5) == 0) {
vec_push_back(v, strdup("PATH=" BBPATH ":/sbin:" MIRRDIR "/system/bin:"
MIRRDIR "/system/xbin:" MIRRDIR "/vendor/bin"));
// Prepend BBPATH to PATH
sprintf(buffer, "PATH="BBPATH":%s", environ[i] + 5);
vec_push_back(v, strdup(buffer));
} else {
vec_push_back(v, strdup(environ[i]));
}