hush: fix 'eval ""' handling

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2016-09-29 01:44:17 +02:00
parent 992e0ff7e9
commit 78c9c736ab
5 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,3 @@
Zero:0
Zero:0
Zero:0

View File

@ -0,0 +1,4 @@
false; eval; echo Zero:$?
false; eval ""; echo Zero:$?
false; eval "
"; echo Zero:$?

View File

@ -5679,7 +5679,7 @@ static char* expand_strvec_to_string(char **argv)
n++; n++;
} }
} }
overlapping_strcpy((char*)list, list[0]); overlapping_strcpy((char*)list, list[0] ? list[0] : "");
debug_printf_expand("strvec_to_string='%s'\n", (char*)list); debug_printf_expand("strvec_to_string='%s'\n", (char*)list);
return (char*)list; return (char*)list;
} }

View File

@ -0,0 +1,3 @@
Zero:0
Zero:0
Zero:0

View File

@ -0,0 +1,4 @@
false; eval; echo Zero:$?
false; eval ""; echo Zero:$?
false; eval "
"; echo Zero:$?