Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 865588 Details for
Bug 1007926
Bash outputs functions with multi-line here-strings incorrectly
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
bash-4.1-multiline_heredoc.patch
bash-4.1-multiline_heredoc.patch (text/plain), 4.24 KB, created by
Petr Stodulka
on 2014-02-20 15:53:53 UTC
(
hide
)
Description:
bash-4.1-multiline_heredoc.patch
Filename:
MIME Type:
Creator:
Petr Stodulka
Created:
2014-02-20 15:53:53 UTC
Size:
4.24 KB
patch
obsolete
>diff --git a/print_cmd.c b/print_cmd.c >index 9a41dcb..922fc09 100644 >--- a/print_cmd.c >+++ b/print_cmd.c >@@ -113,6 +113,12 @@ FILE *xtrace_fp = 0; > > #define CHECK_XTRACE_FP xtrace_fp = (xtrace_fp ? xtrace_fp : stderr) > >+#define PRINT_DEFERRED_HEREDOCS(x) \ >+ do { \ >+ if (deferred_heredocs) \ >+ print_deferred_heredocs (x); \ >+ } while (0) >+ > /* Non-zero means the stuff being printed is inside of a function def. */ > static int inside_function_def; > static int skip_this_indent; >@@ -293,8 +299,7 @@ make_command_string_internal (command) > } > > make_command_string_internal (command->value.Connection->second); >- if (deferred_heredocs) >- print_deferred_heredocs (""); >+ PRINT_DEFERRED_HEREDOCS (""); > printing_connection--; > break; > >@@ -310,6 +315,7 @@ make_command_string_internal (command) > cprintf ("( "); > skip_this_indent++; > make_command_string_internal (command->value.Subshell->command); >+ PRINT_DEFERRED_HEREDOCS (""); > cprintf (" )"); > break; > >@@ -565,6 +571,7 @@ print_for_command (for_command) > newline ("do\n"); > indentation += indentation_amount; > make_command_string_internal (for_command->action); >+ PRINT_DEFERRED_HEREDOCS (""); > semicolon (); > indentation -= indentation_amount; > newline ("done"); >@@ -585,6 +592,7 @@ print_arith_for_command (arith_for_command) > newline ("do\n"); > indentation += indentation_amount; > make_command_string_internal (arith_for_command->action); >+ PRINT_DEFERRED_HEREDOCS (""); > semicolon (); > indentation -= indentation_amount; > newline ("done"); >@@ -620,6 +628,7 @@ print_select_command (select_command) > newline ("do\n"); > indentation += indentation_amount; > make_command_string_internal (select_command->action); >+ PRINT_DEFERRED_HEREDOCS (""); > semicolon (); > indentation -= indentation_amount; > newline ("done"); >@@ -645,6 +654,7 @@ print_group_command (group_command) > } > > make_command_string_internal (group_command->command); >+ PRINT_DEFERRED_HEREDOCS (""); > > if (inside_function_def) > { >@@ -703,6 +713,7 @@ print_case_clauses (clauses) > indentation += indentation_amount; > make_command_string_internal (clauses->action); > indentation -= indentation_amount; >+ PRINT_DEFERRED_HEREDOCS (""); > if (clauses->flags & CASEPAT_FALLTHROUGH) > newline (";&"); > else if (clauses->flags & CASEPAT_TESTNEXT) >@@ -736,10 +747,12 @@ print_until_or_while (while_command, which) > cprintf ("%s ", which); > skip_this_indent++; > make_command_string_internal (while_command->test); >+ PRINT_DEFERRED_HEREDOCS (""); > semicolon (); > cprintf (" do\n"); /* was newline ("do\n"); */ > indentation += indentation_amount; > make_command_string_internal (while_command->action); >+ PRINT_DEFERRED_HEREDOCS (""); > indentation -= indentation_amount; > semicolon (); > newline ("done"); >@@ -756,6 +769,7 @@ print_if_command (if_command) > cprintf (" then\n"); > indentation += indentation_amount; > make_command_string_internal (if_command->true_case); >+ PRINT_DEFERRED_HEREDOCS (""); > indentation -= indentation_amount; > > if (if_command->false_case) >@@ -764,6 +778,7 @@ print_if_command (if_command) > newline ("else\n"); > indentation += indentation_amount; > make_command_string_internal (if_command->false_case); >+ PRINT_DEFERRED_HEREDOCS (""); > indentation -= indentation_amount; > } > semicolon (); >@@ -943,7 +958,7 @@ print_deferred_heredocs (cstring) > cprintf (" "); > print_heredoc_header (hdtail); > } >- if (cstring[0] != ';' || cstring[1]) >+ if (cstring[0] && (cstring[0] != ';' || cstring[1])) > cprintf ("%s", cstring); > if (deferred_heredocs) > cprintf ("\n"); >@@ -1120,6 +1135,10 @@ print_redirection (redirect) > cprintf ("{%s}", redir_word->word); > else if (redirector != 0) > cprintf ("%d", redirector); >+#if 0 >+ /* Don't need to check whether or not to requote, since original quotes >+ are still intact. The only thing that has happened is that $'...' >+ has been replaced with 'expanded ...'. */ > if (ansic_shouldquote (redirect->redirectee.filename->word)) > { > char *x; >@@ -1128,6 +1147,7 @@ print_redirection (redirect) > free (x); > } > else >+#endif > cprintf ("<<< %s", redirect->redirectee.filename->word); > break; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1007926
: 865588