mirror of
https://github.com/sheumann/hush.git
synced 2024-06-01 00:41:33 +00:00
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:
commit
70ea37208b
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -39,3 +39,4 @@ core
|
||||||
#
|
#
|
||||||
/busybox.links
|
/busybox.links
|
||||||
/runtest-tempdir-links
|
/runtest-tempdir-links
|
||||||
|
/testsuite/echo-ne
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#ifndef BUSYBOX_H
|
#ifndef BUSYBOX_H
|
||||||
#define BUSYBOX_H 1
|
#define BUSYBOX_H 1
|
||||||
|
|
||||||
#define BB_VER "1.22.1"
|
#define BB_VER "1.23.0 (GNO hush 0.2)"
|
||||||
|
|
||||||
#include "libbb.h"
|
#include "libbb.h"
|
||||||
/* BB_DIR_foo and BB_SUID_bar constants: */
|
/* BB_DIR_foo and BB_SUID_bar constants: */
|
||||||
|
|
|
@ -682,11 +682,14 @@ extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST
|
||||||
/* Never returns NULL */
|
/* Never returns NULL */
|
||||||
extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
|
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)
|
# 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;
|
unsigned bb_arg_max(void) FAST_FUNC;
|
||||||
#else
|
#else
|
||||||
|
/* If all else fails */
|
||||||
# define bb_arg_max() ((unsigned)(32 * 1024))
|
# define bb_arg_max() ((unsigned)(32 * 1024))
|
||||||
#endif
|
#endif
|
||||||
unsigned bb_clk_tck(void) FAST_FUNC;
|
unsigned bb_clk_tck(void) FAST_FUNC;
|
||||||
|
@ -1145,7 +1148,9 @@ char *bb_simplify_path(const char *path) FAST_FUNC;
|
||||||
/* Returns ptr to NUL */
|
/* Returns ptr to NUL */
|
||||||
char *bb_simplify_abs_path_inplace(char *path) FAST_FUNC;
|
char *bb_simplify_abs_path_inplace(char *path) FAST_FUNC;
|
||||||
|
|
||||||
|
#ifndef LOGIN_FAIL_DELAY
|
||||||
#define LOGIN_FAIL_DELAY 3
|
#define LOGIN_FAIL_DELAY 3
|
||||||
|
#endif
|
||||||
extern void bb_do_delay(int seconds) FAST_FUNC;
|
extern void bb_do_delay(int seconds) FAST_FUNC;
|
||||||
extern void change_identity(const struct passwd *pw) 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;
|
extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) NORETURN FAST_FUNC;
|
||||||
|
|
|
@ -2438,15 +2438,19 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman
|
||||||
|
|
||||||
#ifndef __GNO__
|
#ifndef __GNO__
|
||||||
if (tcgetattr(STDIN_FILENO, &initial_settings) < 0
|
if (tcgetattr(STDIN_FILENO, &initial_settings) < 0
|
||||||
|| !(initial_settings.c_lflag & ECHO)
|
|| (initial_settings.c_lflag & (ECHO|ICANON)) == ICANON
|
||||||
#else
|
#else
|
||||||
if (ioctl(STDIN_FILENO, TIOCGETP, &initial_settings) < 0
|
if (ioctl(STDIN_FILENO, TIOCGETP, &initial_settings) < 0
|
||||||
|| ioctl(STDIN_FILENO, TIOCGETC, &initial_tchars) < 0
|
|| ioctl(STDIN_FILENO, TIOCGETC, &initial_tchars) < 0
|
||||||
|| ioctl(STDIN_FILENO, TIOCGETK, &initial_ttyk) < 0
|
|| ioctl(STDIN_FILENO, TIOCGETK, &initial_ttyk) < 0
|
||||||
|| !(initial_settings.sg_flags & ECHO)
|
|| (initial_settings.sg_flags & (ECHO|CBREAK|RAW)) == 0
|
||||||
#endif
|
#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);
|
parse_and_put_prompt(prompt);
|
||||||
/* fflush_all(); - done by parse_and_put_prompt */
|
/* fflush_all(); - done by parse_and_put_prompt */
|
||||||
if (fgets(command, maxsize, stdin) == NULL)
|
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.
|
* standard readline bindings (IOW: bash) do.
|
||||||
* Often, Alt-<key> generates ESC-<key>.
|
* Often, Alt-<key> generates ESC-<key>.
|
||||||
*/
|
*/
|
||||||
ic = lineedit_read_key(read_key_buffer, timeout);
|
ic = lineedit_read_key(read_key_buffer, 50);
|
||||||
switch (ic) {
|
switch (ic) {
|
||||||
//case KEYCODE_LEFT: - bash doesn't do this
|
//case KEYCODE_LEFT: - bash doesn't do this
|
||||||
case 'b':
|
case 'b':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user