diff options
author | Ron Yorston <rmy@pobox.com> | 2022-06-27 11:23:39 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2022-06-27 11:23:39 +0100 |
commit | b0f279a48f5f7e57b6f6e941e4b59e9a1bc54548 (patch) | |
tree | 86430f2929d8e3eb162bcb83c512bf8a0fffe322 /libbb | |
parent | 164a4253b1b16f3923b175f425074ef2d1b04377 (diff) | |
parent | 2617a5e4c600b4577b2c18f794701276e55da43b (diff) | |
download | busybox-w32-b0f279a48f5f7e57b6f6e941e4b59e9a1bc54548.tar.gz busybox-w32-b0f279a48f5f7e57b6f6e941e4b59e9a1bc54548.tar.bz2 busybox-w32-b0f279a48f5f7e57b6f6e941e4b59e9a1bc54548.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/lineedit.c | 12 | ||||
-rw-r--r-- | libbb/perror_nomsg.c | 4 | ||||
-rw-r--r-- | libbb/perror_nomsg_and_die.c | 4 |
3 files changed, 15 insertions, 5 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index c06b104ff..6994d1da7 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -259,6 +259,16 @@ static const char *get_username_str(void) | |||
259 | 259 | ||
260 | static NOINLINE const char *get_homedir_or_NULL(void) | 260 | static NOINLINE const char *get_homedir_or_NULL(void) |
261 | { | 261 | { |
262 | const char *home; | ||
263 | |||
264 | # if ENABLE_SHELL_ASH || ENABLE_SHELL_HUSH | ||
265 | home = state->sh_get_var ? state->sh_get_var("HOME") : getenv("HOME"); | ||
266 | # else | ||
267 | home = getenv("HOME"); | ||
268 | # endif | ||
269 | if (home != NULL && home[0] != '\0') | ||
270 | return home; | ||
271 | |||
262 | if (!got_user_strings) | 272 | if (!got_user_strings) |
263 | get_user_strings(); | 273 | get_user_strings(); |
264 | return home_pwd_buf; | 274 | return home_pwd_buf; |
@@ -932,7 +942,7 @@ static NOINLINE unsigned complete_cmd_dir_file(const char *command, int type) | |||
932 | continue; | 942 | continue; |
933 | } | 943 | } |
934 | # endif | 944 | # endif |
935 | # if EDITING_HAS_get_exe_name | 945 | # if ENABLE_SHELL_ASH || ENABLE_SHELL_HUSH |
936 | if (state->get_exe_name) { | 946 | if (state->get_exe_name) { |
937 | i = 0; | 947 | i = 0; |
938 | for (;;) { | 948 | for (;;) { |
diff --git a/libbb/perror_nomsg.c b/libbb/perror_nomsg.c index d7d53de44..a2a11cc8e 100644 --- a/libbb/perror_nomsg.c +++ b/libbb/perror_nomsg.c | |||
@@ -12,11 +12,11 @@ | |||
12 | * instead of including libbb.h */ | 12 | * instead of including libbb.h */ |
13 | //#include "libbb.h" | 13 | //#include "libbb.h" |
14 | #include "platform.h" | 14 | #include "platform.h" |
15 | extern void bb_simple_perror_msg(const char *s) FAST_FUNC; | 15 | extern void bb_perror_msg(const char *s, ...) FAST_FUNC; |
16 | 16 | ||
17 | /* suppress gcc "no previous prototype" warning */ | 17 | /* suppress gcc "no previous prototype" warning */ |
18 | void FAST_FUNC bb_perror_nomsg(void); | 18 | void FAST_FUNC bb_perror_nomsg(void); |
19 | void FAST_FUNC bb_perror_nomsg(void) | 19 | void FAST_FUNC bb_perror_nomsg(void) |
20 | { | 20 | { |
21 | bb_simple_perror_msg(0); | 21 | bb_perror_msg(0); |
22 | } | 22 | } |
diff --git a/libbb/perror_nomsg_and_die.c b/libbb/perror_nomsg_and_die.c index bea5f25a5..543ff5178 100644 --- a/libbb/perror_nomsg_and_die.c +++ b/libbb/perror_nomsg_and_die.c | |||
@@ -12,11 +12,11 @@ | |||
12 | * instead of including libbb.h */ | 12 | * instead of including libbb.h */ |
13 | //#include "libbb.h" | 13 | //#include "libbb.h" |
14 | #include "platform.h" | 14 | #include "platform.h" |
15 | extern void bb_simple_perror_msg_and_die(const char *s) FAST_FUNC; | 15 | extern void bb_perror_msg_and_die(const char *s, ...) FAST_FUNC; |
16 | 16 | ||
17 | /* suppress gcc "no previous prototype" warning */ | 17 | /* suppress gcc "no previous prototype" warning */ |
18 | void FAST_FUNC bb_perror_nomsg_and_die(void); | 18 | void FAST_FUNC bb_perror_nomsg_and_die(void); |
19 | void FAST_FUNC bb_perror_nomsg_and_die(void) | 19 | void FAST_FUNC bb_perror_nomsg_and_die(void) |
20 | { | 20 | { |
21 | bb_simple_perror_msg_and_die(0); | 21 | bb_perror_msg_and_die(0); |
22 | } | 22 | } |