Skip to content

Commit 01c4bc2

Browse files
committed
shell: support setting the environment via passed in values
1 parent 126bfc8 commit 01c4bc2

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

shell.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,10 +2066,10 @@ scallop_cb scallop_error;
20662066
scallop_cb scallop_warning;
20672067

20682068
void
2069-
lib_init ()
2069+
lib_init (char **env)
20702070
{
20712071
set_shell_name("scallop");
2072-
shell_environment = environ;
2072+
shell_environment = env;
20732073
shell_initialize();
20742074
}
20752075

@@ -2081,10 +2081,10 @@ lib_error_handlers (scallop_cb error_cb, scallop_cb warning_cb)
20812081
}
20822082

20832083
void
2084-
lib_reset ()
2084+
lib_reset (char **env)
20852085
{
20862086
int orig_restricted = restricted;
2087-
shell_environment = environ;
2087+
shell_environment = env;
20882088
shell_reinitialize();
20892089
restricted = orig_restricted;
20902090
initialize_shell_variables (shell_environment, privileged_mode||restricted||running_setuid);

shell.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ typedef void (*scallop_cb)(char *);
266266
extern scallop_cb scallop_error;
267267
extern scallop_cb scallop_warning;
268268

269-
extern void lib_init (void);
269+
extern void lib_init (char **);
270270
extern void lib_error_handlers (scallop_cb error_cb, scallop_cb warning_cb);
271-
extern void lib_reset (void);
271+
extern void lib_reset (char **);
272272

273273
extern void scallop_toggle_restricted (int);
274274
#endif

0 commit comments

Comments
 (0)