Diff between c9589c1b1450d7f1f1716c01aaed43ada6d14160 and 84a3cadcd9f214d1bb20d2cd3eb2c81deeb1d41d
Changed Files
| File | Additions | Deletions | Status |
| src/shared/shell.c | +5 | -0 | modified |
Full Patch
diff --git a/src/shared/shell.c b/src/shared/shell.c
index 97d9157..e87336a 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -63,6 +63,7 @@ struct bt_shell_env {
static struct {
bool init;
+ char *name;
int argc;
char **argv;
bool mode;
@@ -978,6 +979,9 @@ void bt_shell_init(int argc, char **argv, const struct bt_shell_opt *opt)
index = -1;
}
+ data.name = strdup(argv[0]);
+ bt_shell_set_env("SHELL", data.name);
+
data.argc = argc - optind;
data.argv = argv + optind;
optind = 0;
@@ -1039,6 +1043,7 @@ void bt_shell_cleanup(void)
rl_cleanup();
data.init = false;
+ free(data.name);
}
void bt_shell_quit(int status)