summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2010-05-17 10:10:01 +0200
committerDenys Vlasenko2010-05-17 10:10:01 +0200
commit82dd14a510caf192c90e764f36bf424d647b5376 (patch)
tree22c0c07c49820118decb2d50186a19c9cc3dce5e
parentef215558fa261d0aeb653ea49efebcf2811d59a3 (diff)
downloadbusybox-82dd14a510caf192c90e764f36bf424d647b5376.zip
busybox-82dd14a510caf192c90e764f36bf424d647b5376.tar.gz
ash: use CONFIG_FEATURE_EDITING_MAX_LEN
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--init/bootchartd.c2
-rw-r--r--shell/ash.c13
2 files changed, 7 insertions, 8 deletions
diff --git a/init/bootchartd.c b/init/bootchartd.c
index 9faf14d..d1f9ed3 100644
--- a/init/bootchartd.c
+++ b/init/bootchartd.c
@@ -57,7 +57,7 @@
/* Globals */
struct globals {
- char jiffy_line[sizeof(bb_common_bufsiz1)];
+ char jiffy_line[COMMON_BUFSIZE];
} FIX_ALIASING;
#define G (*(struct globals*)&bb_common_bufsiz1)
#define INIT_G() do { } while (0)
diff --git a/shell/ash.c b/shell/ash.c
index ef22da1..75bfbf1 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -2589,9 +2589,7 @@ pwdcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
/* ============ ... */
-#define IBUFSIZ COMMON_BUFSIZE
-/* buffer for top level input file */
-#define basebuf bb_common_bufsiz1
+#define IBUFSIZ (ENABLE_FEATURE_EDITING ? CONFIG_FEATURE_EDITING_MAX_LEN : 1024)
/* Syntax classes */
#define CWORD 0 /* character is nothing special */
@@ -9447,12 +9445,12 @@ preadfd(void)
#if ENABLE_FEATURE_EDITING
retry:
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 {
#if ENABLE_FEATURE_TAB_COMPLETION
line_input_state->path_lookup = pathval();
#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) {
/* Ctrl+C pressed */
if (trap[SIGINT]) {
@@ -9469,7 +9467,7 @@ preadfd(void)
}
}
#else
- nr = nonblock_safe_read(g_parsefile->fd, buf, BUFSIZ - 1);
+ nr = nonblock_safe_read(g_parsefile->fd, buf, IBUFSIZ - 1);
#endif
#if 0
@@ -12728,7 +12726,8 @@ static void
init(void)
{
/* 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: */
signal(SIGCHLD, SIG_DFL);