projects
/
platform
/
upstream
/
bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3c68b89
)
shared/shell: Set shell name on SHELL env
91/221491/1
author
Luiz Augusto von Dentz
<luiz.von.dentz@intel.com>
Wed, 13 Jun 2018 11:19:28 +0000
(14:19 +0300)
committer
himanshu
<h.himanshu@samsung.com>
Fri, 3 Jan 2020 04:43:19 +0000
(10:13 +0530)
This set SHELL to the first argument given.
Change-Id: I51d0e2f67d7c61a6123b5100f09acb36955f9fce
Signed-off-by: himanshu <h.himanshu@samsung.com>
src/shared/shell.c
patch
|
blob
|
history
diff --git
a/src/shared/shell.c
b/src/shared/shell.c
index
97d9157
..
e87336a
100644
(file)
--- 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)