shell/ash_test/ash-heredoc/heredoc_empty3.right+2 -0
shell/ash_test/ash-heredoc/heredoc_empty3.tests+4 -0
| @@ -0,0 +1,4 @@ |
| + | cat <<EOF |
| + | |
| + | Ok |
| + | EOF |
shell/hush.c+8 -0
| @@ -4226,6 +4226,14 @@ static char *fetch_till_str(o_string *as_string, |
| int prev = 0; /* not \ */ |
| int ch; |
| |
| + | /* Starting with "" is necessary for this case: |
| + | * cat <<EOF |
| + | * |
| + | * xxx |
| + | * EOF |
| + | */ |
| + | heredoc.data = xzalloc(1); /* start as "", not as NULL */ |
| + | |
| goto jump_in; |
| |
| while (1) { |
shell/hush_test/hush-heredoc/heredoc_empty3.right+2 -0
shell/hush_test/hush-heredoc/heredoc_empty3.tests+4 -0
| @@ -0,0 +1,4 @@ |
| + | cat <<EOF |
| + | |
| + | Ok |
| + | EOF |