← Commit list

8b08d5a50

Denys Vlasenko
Denys Vlasenko
2018-07-18
SUCCESS Duration: 151s

Subject

hush: smaller code to set o_string to ""

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/hush.c+2 -4
@@ -4997,8 +4997,7 @@ static struct pipe *parse_stream(char **pstring,
/* If very first arg is "" or '', ctx.word.data may end up NULL.
* Preventing this:
*/
- o_addchr(&ctx.word, '\0');
- ctx.word.length = 0;
+ ctx.word.data = xzalloc(1); /* start as "", not as NULL */
/* We used to separate words on $IFS here. This was wrong.
* $IFS is used only for word splitting when $var is expanded,
@@ -5795,8 +5794,7 @@ static char *encode_then_expand_vararg(const char *str, int handle_squotes, int
*/
setup_string_in_str(&input, str);
- o_addchr(&dest, '\0');
- dest.length = 0;
+ dest.data = xzalloc(1); /* start as "", not as NULL */
exp_str = NULL;
for (;;) {