version 1.102, 2019/12/21 15:31:54 |
version 1.103, 2019/12/22 09:26:23 |
|
|
#define VAR_FROM_CMD 4 /* Special source: command line */ |
#define VAR_FROM_CMD 4 /* Special source: command line */ |
#define VAR_FROM_ENV 8 /* Special source: environment */ |
#define VAR_FROM_ENV 8 /* Special source: environment */ |
#define VAR_SEEN_ENV 16 /* No need to go look up environment again */ |
#define VAR_SEEN_ENV 16 /* No need to go look up environment again */ |
#define VAR_SHELL 32 /* Magic behavior */ |
#define VAR_IS_SHELL 32 /* Magic behavior */ |
|
|
#define POISONS (POISON_NORMAL | POISON_EMPTY | POISON_NOT_DEFINED) |
#define POISONS (POISON_NORMAL | POISON_EMPTY | POISON_NOT_DEFINED) |
/* Defined in var.h */ |
/* Defined in var.h */ |
|
|
if (ctxt == VAR_CMD) { /* always for command line */ |
if (ctxt == VAR_CMD) { /* always for command line */ |
(append ? var_append_value : var_set_value)(v, val); |
(append ? var_append_value : var_set_value)(v, val); |
v->flags |= VAR_FROM_CMD; |
v->flags |= VAR_FROM_CMD; |
if ((v->flags & VAR_SHELL) == 0) { |
if ((v->flags & VAR_IS_SHELL) == 0) { |
/* Any variables given on the command line are |
/* Any variables given on the command line are |
* automatically exported to the environment, |
* automatically exported to the environment, |
* except for SHELL (as per POSIX standard). |
* except for SHELL (as per POSIX standard). |
|
|
v = find_global_var_without_env(name, ename, k); |
v = find_global_var_without_env(name, ename, k); |
var_set_value(v, _PATH_BSHELL); |
var_set_value(v, _PATH_BSHELL); |
/* XXX the environment shall never affect it */ |
/* XXX the environment shall never affect it */ |
v->flags = VAR_SHELL | VAR_SEEN_ENV; |
v->flags = VAR_IS_SHELL | VAR_SEEN_ENV; |
} |
} |
|
|
/* |
/* |