aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 8dc531657..af3b95b86 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -352,6 +352,7 @@
352#define BASH_SOURCE ENABLE_HUSH_BASH_COMPAT 352#define BASH_SOURCE ENABLE_HUSH_BASH_COMPAT
353#define BASH_HOSTNAME_VAR ENABLE_HUSH_BASH_COMPAT 353#define BASH_HOSTNAME_VAR ENABLE_HUSH_BASH_COMPAT
354#define BASH_TEST2 (ENABLE_HUSH_BASH_COMPAT && ENABLE_HUSH_TEST) 354#define BASH_TEST2 (ENABLE_HUSH_BASH_COMPAT && ENABLE_HUSH_TEST)
355#define BASH_READ_D ENABLE_HUSH_BASH_COMPAT
355 356
356 357
357/* Build knobs */ 358/* Build knobs */
@@ -9434,13 +9435,20 @@ static int FAST_FUNC builtin_read(char **argv)
9434 char *opt_p = NULL; 9435 char *opt_p = NULL;
9435 char *opt_t = NULL; 9436 char *opt_t = NULL;
9436 char *opt_u = NULL; 9437 char *opt_u = NULL;
9438 char *opt_d = NULL; /* optimized out if !BASH */
9437 const char *ifs; 9439 const char *ifs;
9438 int read_flags; 9440 int read_flags;
9439 9441
9440 /* "!": do not abort on errors. 9442 /* "!": do not abort on errors.
9441 * Option string must start with "sr" to match BUILTIN_READ_xxx 9443 * Option string must start with "sr" to match BUILTIN_READ_xxx
9442 */ 9444 */
9443 read_flags = getopt32(argv, "!srn:p:t:u:", &opt_n, &opt_p, &opt_t, &opt_u); 9445 read_flags = getopt32(argv,
9446#if BASH_READ_D
9447 "!srn:p:t:u:d:", &opt_n, &opt_p, &opt_t, &opt_u, &opt_d
9448#else
9449 "!srn:p:t:u:", &opt_n, &opt_p, &opt_t, &opt_u
9450#endif
9451 );
9444 if (read_flags == (uint32_t)-1) 9452 if (read_flags == (uint32_t)-1)
9445 return EXIT_FAILURE; 9453 return EXIT_FAILURE;
9446 argv += optind; 9454 argv += optind;
@@ -9454,7 +9462,8 @@ static int FAST_FUNC builtin_read(char **argv)
9454 opt_n, 9462 opt_n,
9455 opt_p, 9463 opt_p,
9456 opt_t, 9464 opt_t,
9457 opt_u 9465 opt_u,
9466 opt_d
9458 ); 9467 );
9459 9468
9460 if ((uintptr_t)r == 1 && errno == EINTR) { 9469 if ((uintptr_t)r == 1 && errno == EINTR) {