mirror of
https://github.com/sheumann/hush.git
synced 2024-12-21 23:29:34 +00:00
ash: use CONFIG_FEATURE_EDITING_MAX_LEN
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
ef215558fa
commit
82dd14a510
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
/* Globals */
|
/* Globals */
|
||||||
struct globals {
|
struct globals {
|
||||||
char jiffy_line[sizeof(bb_common_bufsiz1)];
|
char jiffy_line[COMMON_BUFSIZE];
|
||||||
} FIX_ALIASING;
|
} FIX_ALIASING;
|
||||||
#define G (*(struct globals*)&bb_common_bufsiz1)
|
#define G (*(struct globals*)&bb_common_bufsiz1)
|
||||||
#define INIT_G() do { } while (0)
|
#define INIT_G() do { } while (0)
|
||||||
|
13
shell/ash.c
13
shell/ash.c
@ -2589,9 +2589,7 @@ pwdcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
|
|||||||
/* ============ ... */
|
/* ============ ... */
|
||||||
|
|
||||||
|
|
||||||
#define IBUFSIZ COMMON_BUFSIZE
|
#define IBUFSIZ (ENABLE_FEATURE_EDITING ? CONFIG_FEATURE_EDITING_MAX_LEN : 1024)
|
||||||
/* buffer for top level input file */
|
|
||||||
#define basebuf bb_common_bufsiz1
|
|
||||||
|
|
||||||
/* Syntax classes */
|
/* Syntax classes */
|
||||||
#define CWORD 0 /* character is nothing special */
|
#define CWORD 0 /* character is nothing special */
|
||||||
@ -9447,12 +9445,12 @@ preadfd(void)
|
|||||||
#if ENABLE_FEATURE_EDITING
|
#if ENABLE_FEATURE_EDITING
|
||||||
retry:
|
retry:
|
||||||
if (!iflag || g_parsefile->fd != STDIN_FILENO)
|
if (!iflag || g_parsefile->fd != STDIN_FILENO)
|
||||||
nr = nonblock_safe_read(g_parsefile->fd, buf, BUFSIZ - 1);
|
nr = nonblock_safe_read(g_parsefile->fd, buf, IBUFSIZ - 1);
|
||||||
else {
|
else {
|
||||||
#if ENABLE_FEATURE_TAB_COMPLETION
|
#if ENABLE_FEATURE_TAB_COMPLETION
|
||||||
line_input_state->path_lookup = pathval();
|
line_input_state->path_lookup = pathval();
|
||||||
#endif
|
#endif
|
||||||
nr = read_line_input(cmdedit_prompt, buf, BUFSIZ, line_input_state);
|
nr = read_line_input(cmdedit_prompt, buf, IBUFSIZ, line_input_state);
|
||||||
if (nr == 0) {
|
if (nr == 0) {
|
||||||
/* Ctrl+C pressed */
|
/* Ctrl+C pressed */
|
||||||
if (trap[SIGINT]) {
|
if (trap[SIGINT]) {
|
||||||
@ -9469,7 +9467,7 @@ preadfd(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
nr = nonblock_safe_read(g_parsefile->fd, buf, BUFSIZ - 1);
|
nr = nonblock_safe_read(g_parsefile->fd, buf, IBUFSIZ - 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@ -12728,7 +12726,8 @@ static void
|
|||||||
init(void)
|
init(void)
|
||||||
{
|
{
|
||||||
/* from input.c: */
|
/* from input.c: */
|
||||||
basepf.next_to_pgetc = basepf.buf = basebuf;
|
/* we will never free this */
|
||||||
|
basepf.next_to_pgetc = basepf.buf = ckmalloc(IBUFSIZ);
|
||||||
|
|
||||||
/* from trap.c: */
|
/* from trap.c: */
|
||||||
signal(SIGCHLD, SIG_DFL);
|
signal(SIGCHLD, SIG_DFL);
|
||||||
|
Loading…
Reference in New Issue
Block a user