43 lines
1.2 KiB
Diff
43 lines
1.2 KiB
Diff
---
|
|
builtins/read.def | 9 ++++++---
|
|
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
Index: builtins/read.def
|
|
===================================================================
|
|
--- builtins/read.def.orig 2007-11-10 01:20:45.000000000 +0100
|
|
+++ builtins/read.def 2007-11-10 02:03:38.000000000 +0100
|
|
@@ -134,7 +134,7 @@ read_builtin (list)
|
|
intmax_t intval;
|
|
char c;
|
|
char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname;
|
|
- char *e, *t, *t1, *ps2;
|
|
+ char *e, *t, *t1, *t2, *ps2;
|
|
struct stat tsb;
|
|
SHELL_VAR *var;
|
|
#if defined (ARRAY_VARS)
|
|
@@ -677,12 +677,14 @@ add_char:
|
|
if (*input_string)
|
|
{
|
|
t1 = input_string;
|
|
- t = get_word_from_string (&input_string, ifs_chars, &e);
|
|
+ t2 = get_word_from_string (&input_string, ifs_chars, &e);
|
|
if (*input_string == 0)
|
|
- input_string = t;
|
|
+ input_string = t2;
|
|
else
|
|
input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape);
|
|
}
|
|
+ else
|
|
+ t2 = NULL;
|
|
#endif
|
|
|
|
if (saw_escape)
|
|
@@ -696,6 +698,7 @@ add_char:
|
|
stupidly_hack_special_variables (list->word->word);
|
|
if (var)
|
|
VUNSETATTR (var, att_invisible);
|
|
+ FREE (t2);
|
|
xfree (orig_input_string);
|
|
|
|
return (retval);
|