diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/appletlib.c | 8 | ||||
-rw-r--r-- | libbb/duration.c | 6 | ||||
-rw-r--r-- | libbb/hash_md5_sha256_x86-32_shaNI.S | 3 | ||||
-rw-r--r-- | libbb/hash_md5_sha256_x86-64_shaNI.S | 3 | ||||
-rw-r--r-- | libbb/hash_md5_sha_x86-32_shaNI.S | 3 | ||||
-rw-r--r-- | libbb/hash_md5_sha_x86-64.S | 3 | ||||
-rwxr-xr-x | libbb/hash_md5_sha_x86-64.S.sh | 3 | ||||
-rw-r--r-- | libbb/hash_md5_sha_x86-64_shaNI.S | 3 | ||||
-rw-r--r-- | libbb/lineedit.c | 6 |
9 files changed, 35 insertions, 3 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 99f0cb89c..a90d0cdb5 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -319,7 +319,6 @@ void lbb_prepare(const char *applet | |||
319 | /* Redundant for busybox (run_applet_and_exit covers that case) | 319 | /* Redundant for busybox (run_applet_and_exit covers that case) |
320 | * but needed for "individual applet" mode */ | 320 | * but needed for "individual applet" mode */ |
321 | if (argv[1] | 321 | if (argv[1] |
322 | && !argv[2] | ||
323 | && strcmp(argv[1], "--help") == 0 | 322 | && strcmp(argv[1], "--help") == 0 |
324 | && !is_prefixed_with(applet, "busybox") | 323 | && !is_prefixed_with(applet, "busybox") |
325 | ) { | 324 | ) { |
@@ -1115,12 +1114,15 @@ void FAST_FUNC show_usage_if_dash_dash_help(int applet_no, char **argv) | |||
1115 | # if defined APPLET_NO_echo | 1114 | # if defined APPLET_NO_echo |
1116 | && applet_no != APPLET_NO_echo | 1115 | && applet_no != APPLET_NO_echo |
1117 | # endif | 1116 | # endif |
1117 | # if ENABLE_TEST1 || ENABLE_TEST2 | ||
1118 | && argv[0][0] != '[' /* exclude [ --help ] and [[ --help ]] too */ | ||
1119 | # endif | ||
1118 | # if ENABLE_PLATFORM_MINGW32 && defined APPLET_NO_busybox | 1120 | # if ENABLE_PLATFORM_MINGW32 && defined APPLET_NO_busybox |
1119 | && applet_no != APPLET_NO_busybox | 1121 | && applet_no != APPLET_NO_busybox |
1120 | # endif | 1122 | # endif |
1121 | ) { | 1123 | ) { |
1122 | if (argv[1] && !argv[2] && strcmp(argv[1], "--help") == 0) { | 1124 | if (argv[1] && strcmp(argv[1], "--help") == 0) { |
1123 | /* Make "foo --help" exit with 0: */ | 1125 | /* Make "foo --help [...]" exit with 0: */ |
1124 | xfunc_error_retval = 0; | 1126 | xfunc_error_retval = 0; |
1125 | bb_show_usage(); | 1127 | bb_show_usage(); |
1126 | } | 1128 | } |
diff --git a/libbb/duration.c b/libbb/duration.c index a6a29ddae..793d02f42 100644 --- a/libbb/duration.c +++ b/libbb/duration.c | |||
@@ -76,6 +76,12 @@ void FAST_FUNC sleep_for_duration(duration_t duration) | |||
76 | ts.tv_sec = duration; | 76 | ts.tv_sec = duration; |
77 | ts.tv_nsec = (duration - ts.tv_sec) * 1000000000; | 77 | ts.tv_nsec = (duration - ts.tv_sec) * 1000000000; |
78 | } | 78 | } |
79 | /* NB: if ENABLE_ASH_SLEEP, we end up here if "sleep N" | ||
80 | * is run in ash. ^C will still work, because ash's signal handler | ||
81 | * does not return (it longjumps), the below loop | ||
82 | * will not continue looping. | ||
83 | * (This wouldn't work in hush) | ||
84 | */ | ||
79 | do { | 85 | do { |
80 | errno = 0; | 86 | errno = 0; |
81 | nanosleep(&ts, &ts); | 87 | nanosleep(&ts, &ts); |
diff --git a/libbb/hash_md5_sha256_x86-32_shaNI.S b/libbb/hash_md5_sha256_x86-32_shaNI.S index 3905bad9a..a0e4a571a 100644 --- a/libbb/hash_md5_sha256_x86-32_shaNI.S +++ b/libbb/hash_md5_sha256_x86-32_shaNI.S | |||
@@ -19,6 +19,9 @@ | |||
19 | // We do not check SSSE3 in cpuid, | 19 | // We do not check SSSE3 in cpuid, |
20 | // all SHA-capable CPUs support it as well. | 20 | // all SHA-capable CPUs support it as well. |
21 | 21 | ||
22 | #ifdef __linux__ | ||
23 | .section .note.GNU-stack, "", @progbits | ||
24 | #endif | ||
22 | .section .text.sha256_process_block64_shaNI, "ax", @progbits | 25 | .section .text.sha256_process_block64_shaNI, "ax", @progbits |
23 | .globl sha256_process_block64_shaNI | 26 | .globl sha256_process_block64_shaNI |
24 | .hidden sha256_process_block64_shaNI | 27 | .hidden sha256_process_block64_shaNI |
diff --git a/libbb/hash_md5_sha256_x86-64_shaNI.S b/libbb/hash_md5_sha256_x86-64_shaNI.S index 082ceafe4..172c2eae2 100644 --- a/libbb/hash_md5_sha256_x86-64_shaNI.S +++ b/libbb/hash_md5_sha256_x86-64_shaNI.S | |||
@@ -19,6 +19,9 @@ | |||
19 | // We do not check SSSE3 in cpuid, | 19 | // We do not check SSSE3 in cpuid, |
20 | // all SHA-capable CPUs support it as well. | 20 | // all SHA-capable CPUs support it as well. |
21 | 21 | ||
22 | #ifdef __linux__ | ||
23 | .section .note.GNU-stack, "", @progbits | ||
24 | #endif | ||
22 | .section .text.sha256_process_block64_shaNI, "ax", @progbits | 25 | .section .text.sha256_process_block64_shaNI, "ax", @progbits |
23 | .globl sha256_process_block64_shaNI | 26 | .globl sha256_process_block64_shaNI |
24 | .hidden sha256_process_block64_shaNI | 27 | .hidden sha256_process_block64_shaNI |
diff --git a/libbb/hash_md5_sha_x86-32_shaNI.S b/libbb/hash_md5_sha_x86-32_shaNI.S index 2366b046a..7455a29f0 100644 --- a/libbb/hash_md5_sha_x86-32_shaNI.S +++ b/libbb/hash_md5_sha_x86-32_shaNI.S | |||
@@ -25,6 +25,9 @@ | |||
25 | // We do not check SSSE3/SSE4.1 in cpuid, | 25 | // We do not check SSSE3/SSE4.1 in cpuid, |
26 | // all SHA-capable CPUs support them as well. | 26 | // all SHA-capable CPUs support them as well. |
27 | 27 | ||
28 | #ifdef __linux__ | ||
29 | .section .note.GNU-stack, "", @progbits | ||
30 | #endif | ||
28 | .section .text.sha1_process_block64_shaNI, "ax", @progbits | 31 | .section .text.sha1_process_block64_shaNI, "ax", @progbits |
29 | .globl sha1_process_block64_shaNI | 32 | .globl sha1_process_block64_shaNI |
30 | .hidden sha1_process_block64_shaNI | 33 | .hidden sha1_process_block64_shaNI |
diff --git a/libbb/hash_md5_sha_x86-64.S b/libbb/hash_md5_sha_x86-64.S index 1d55b91f8..2cdd22015 100644 --- a/libbb/hash_md5_sha_x86-64.S +++ b/libbb/hash_md5_sha_x86-64.S | |||
@@ -1,6 +1,9 @@ | |||
1 | ### Generated by hash_md5_sha_x86-64.S.sh ### | 1 | ### Generated by hash_md5_sha_x86-64.S.sh ### |
2 | 2 | ||
3 | #if CONFIG_SHA1_SMALL == 0 && defined(__GNUC__) && defined(__x86_64__) | 3 | #if CONFIG_SHA1_SMALL == 0 && defined(__GNUC__) && defined(__x86_64__) |
4 | #ifdef __linux__ | ||
5 | .section .note.GNU-stack, "", @progbits | ||
6 | #endif | ||
4 | .section .text.sha1_process_block64, "ax", @progbits | 7 | .section .text.sha1_process_block64, "ax", @progbits |
5 | .globl sha1_process_block64 | 8 | .globl sha1_process_block64 |
6 | .hidden sha1_process_block64 | 9 | .hidden sha1_process_block64 |
diff --git a/libbb/hash_md5_sha_x86-64.S.sh b/libbb/hash_md5_sha_x86-64.S.sh index 40c979d35..653fe4989 100755 --- a/libbb/hash_md5_sha_x86-64.S.sh +++ b/libbb/hash_md5_sha_x86-64.S.sh | |||
@@ -127,6 +127,9 @@ echo \ | |||
127 | "### Generated by hash_md5_sha_x86-64.S.sh ### | 127 | "### Generated by hash_md5_sha_x86-64.S.sh ### |
128 | 128 | ||
129 | #if CONFIG_SHA1_SMALL == 0 && defined(__GNUC__) && defined(__x86_64__) | 129 | #if CONFIG_SHA1_SMALL == 0 && defined(__GNUC__) && defined(__x86_64__) |
130 | #ifdef __linux__ | ||
131 | .section .note.GNU-stack, \"\", @progbits | ||
132 | #endif | ||
130 | .section .text.sha1_process_block64, \"ax\", @progbits | 133 | .section .text.sha1_process_block64, \"ax\", @progbits |
131 | .globl sha1_process_block64 | 134 | .globl sha1_process_block64 |
132 | .hidden sha1_process_block64 | 135 | .hidden sha1_process_block64 |
diff --git a/libbb/hash_md5_sha_x86-64_shaNI.S b/libbb/hash_md5_sha_x86-64_shaNI.S index 794e97040..2f03e1ce4 100644 --- a/libbb/hash_md5_sha_x86-64_shaNI.S +++ b/libbb/hash_md5_sha_x86-64_shaNI.S | |||
@@ -25,6 +25,9 @@ | |||
25 | // We do not check SSSE3/SSE4.1 in cpuid, | 25 | // We do not check SSSE3/SSE4.1 in cpuid, |
26 | // all SHA-capable CPUs support them as well. | 26 | // all SHA-capable CPUs support them as well. |
27 | 27 | ||
28 | #ifdef __linux__ | ||
29 | .section .note.GNU-stack, "", @progbits | ||
30 | #endif | ||
28 | .section .text.sha1_process_block64_shaNI, "ax", @progbits | 31 | .section .text.sha1_process_block64_shaNI, "ax", @progbits |
29 | .globl sha1_process_block64_shaNI | 32 | .globl sha1_process_block64_shaNI |
30 | .hidden sha1_process_block64_shaNI | 33 | .hidden sha1_process_block64_shaNI |
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 6994d1da7..c5d5808f5 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -2154,7 +2154,13 @@ static void parse_and_put_prompt(const char *prmt_ptr) | |||
2154 | case 'W': /* basename of cur dir */ | 2154 | case 'W': /* basename of cur dir */ |
2155 | if (!cwd_buf) { | 2155 | if (!cwd_buf) { |
2156 | const char *home; | 2156 | const char *home; |
2157 | #if ENABLE_SHELL_ASH | ||
2158 | cwd_buf = state->sh_get_var | ||
2159 | ? xstrdup(state->sh_get_var("PWD")) | ||
2160 | : xrealloc_getcwd_or_warn(NULL); | ||
2161 | #else | ||
2157 | cwd_buf = xrealloc_getcwd_or_warn(NULL); | 2162 | cwd_buf = xrealloc_getcwd_or_warn(NULL); |
2163 | #endif | ||
2158 | if (!cwd_buf) | 2164 | if (!cwd_buf) |
2159 | cwd_buf = (char *)bb_msg_unknown; | 2165 | cwd_buf = (char *)bb_msg_unknown; |
2160 | else if ((home = get_homedir_or_NULL()) != NULL && home[0]) { | 2166 | else if ((home = get_homedir_or_NULL()) != NULL && home[0]) { |