summaryrefslogtreecommitdiff
path: root/bashhist.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2020-09-09 15:25:32 -0400
committerChet Ramey <chet.ramey@case.edu>2020-09-09 15:25:32 -0400
commit3eb0018e75b74bb886df7fba4b1712529ce7258f (patch)
tree13b53713ef8f483a82295324e314da48b59c9346 /bashhist.c
parent712f80b0a49c3a0227d0b52bff5e0b763747697e (diff)
downloadbash-5.1-beta.tar.gz
bash-5.1 beta releasebash-5.1-beta
Diffstat (limited to 'bashhist.c')
-rw-r--r--bashhist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bashhist.c b/bashhist.c
index 7ccd4746..2a05a53f 100644
--- a/bashhist.c
+++ b/bashhist.c
@@ -757,7 +757,7 @@ maybe_add_history (line)
int is_comment;
hist_last_line_added = 0;
- is_comment = shell_comment (line);
+ is_comment = (parser_state & PST_HEREDOC) ? 0 : shell_comment (line);
/* Don't use the value of history_control to affect the second
and subsequent lines of a multi-line command (old code did
@@ -874,7 +874,7 @@ bash_add_history (line)
add_it = 1;
if (command_oriented_history && current_command_line_count > 1)
{
- is_comment = shell_comment (line);
+ is_comment = (parser_state & PST_HEREDOC) ? 0 : shell_comment (line);
/* The second and subsequent lines of a here document have the trailing
newline preserved. We don't want to add extra newlines here, but we