Merge with BusyBox 1.23.0.

The only substantive change is about when simple line input mode is used.

I also bumped the version number and included a GNO-version-specific component.
This commit is contained in:
Stephen Heumann 2014-12-27 13:33:41 -06:00
commit 70ea37208b
4 changed files with 17 additions and 7 deletions

1
.gitignore vendored
View File

@ -39,3 +39,4 @@ core
#
/busybox.links
/runtest-tempdir-links
/testsuite/echo-ne

View File

@ -5,7 +5,7 @@
#ifndef BUSYBOX_H
#define BUSYBOX_H 1
#define BB_VER "1.22.1"
#define BB_VER "1.23.0 (GNO hush 0.2)"
#include "libbb.h"
/* BB_DIR_foo and BB_SUID_bar constants: */

View File

@ -682,11 +682,14 @@ extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST
/* Never returns NULL */
extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
#if defined ARG_MAX
#if defined(ARG_MAX) && (ARG_MAX >= 60*1024 || !defined(_SC_ARG_MAX))
/* Use _constant_ maximum if: defined && (big enough || no variable one exists) */
# define bb_arg_max() ((unsigned)ARG_MAX)
#elif defined _SC_ARG_MAX
#elif defined(_SC_ARG_MAX)
/* Else use variable one (a bit more expensive) */
unsigned bb_arg_max(void) FAST_FUNC;
#else
/* If all else fails */
# define bb_arg_max() ((unsigned)(32 * 1024))
#endif
unsigned bb_clk_tck(void) FAST_FUNC;
@ -1145,7 +1148,9 @@ char *bb_simplify_path(const char *path) FAST_FUNC;
/* Returns ptr to NUL */
char *bb_simplify_abs_path_inplace(char *path) FAST_FUNC;
#ifndef LOGIN_FAIL_DELAY
#define LOGIN_FAIL_DELAY 3
#endif
extern void bb_do_delay(int seconds) FAST_FUNC;
extern void change_identity(const struct passwd *pw) FAST_FUNC;
extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) NORETURN FAST_FUNC;

View File

@ -2438,15 +2438,19 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman
#ifndef __GNO__
if (tcgetattr(STDIN_FILENO, &initial_settings) < 0
|| !(initial_settings.c_lflag & ECHO)
|| (initial_settings.c_lflag & (ECHO|ICANON)) == ICANON
#else
if (ioctl(STDIN_FILENO, TIOCGETP, &initial_settings) < 0
|| ioctl(STDIN_FILENO, TIOCGETC, &initial_tchars) < 0
|| ioctl(STDIN_FILENO, TIOCGETK, &initial_ttyk) < 0
|| !(initial_settings.sg_flags & ECHO)
|| (initial_settings.sg_flags & (ECHO|CBREAK|RAW)) == 0
#endif
) {
/* Happens when e.g. stty -echo was run before */
/* Happens when e.g. stty -echo was run before.
* But if ICANON is not set, we don't come here.
* (example: interactive python ^Z-backgrounded,
* tty is still in "raw mode").
*/
parse_and_put_prompt(prompt);
/* fflush_all(); - done by parse_and_put_prompt */
if (fgets(command, maxsize, stdin) == NULL)
@ -2815,7 +2819,7 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman
* standard readline bindings (IOW: bash) do.
* Often, Alt-<key> generates ESC-<key>.
*/
ic = lineedit_read_key(read_key_buffer, timeout);
ic = lineedit_read_key(read_key_buffer, 50);
switch (ic) {
//case KEYCODE_LEFT: - bash doesn't do this
case 'b':