#include "doas.h"
#include "includes.h"
+const char *formerpath;
+
struct envnode {
RB_ENTRY(envnode) node;
const char *key;
/* assign value or inherit from environ */
if (eq) {
val = eq + 1;
- if (*val == '$')
- val = getenv(val + 1);
+ if (*val == '$') {
+ if (strcmp(val + 1, "PATH") == 0)
+ val = formerpath;
+ else
+ val = getenv(val + 1);
+ }
} else {
val = getenv(name);
}