aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2022-06-27 11:23:39 +0100
committerRon Yorston <rmy@pobox.com>2022-06-27 11:23:39 +0100
commitb0f279a48f5f7e57b6f6e941e4b59e9a1bc54548 (patch)
tree86430f2929d8e3eb162bcb83c512bf8a0fffe322 /libbb
parent164a4253b1b16f3923b175f425074ef2d1b04377 (diff)
parent2617a5e4c600b4577b2c18f794701276e55da43b (diff)
downloadbusybox-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.c12
-rw-r--r--libbb/perror_nomsg.c4
-rw-r--r--libbb/perror_nomsg_and_die.c4
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
260static NOINLINE const char *get_homedir_or_NULL(void) 260static 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"
15extern void bb_simple_perror_msg(const char *s) FAST_FUNC; 15extern 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 */
18void FAST_FUNC bb_perror_nomsg(void); 18void FAST_FUNC bb_perror_nomsg(void);
19void FAST_FUNC bb_perror_nomsg(void) 19void 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"
15extern void bb_simple_perror_msg_and_die(const char *s) FAST_FUNC; 15extern 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 */
18void FAST_FUNC bb_perror_nomsg_and_die(void); 18void FAST_FUNC bb_perror_nomsg_and_die(void);
19void FAST_FUNC bb_perror_nomsg_and_die(void) 19void 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}