summary refs log tree commit diff
path: root/Src/zsh.h
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-03-14 11:40:57 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-03-14 11:40:57 +0000
commit948f015df0fee27f4e2c73b442a75c9434702550 (patch)
tree0d28c6e4ad0bd849702de39e544c597634ff7283 /Src/zsh.h
parent2ca42b2025cceaabd64889aa3b932195e8d5720c (diff)
downloadzsh-948f015df0fee27f4e2c73b442a75c9434702550.tar.gz
zsh-948f015df0fee27f4e2c73b442a75c9434702550.tar.xz
zsh-948f015df0fee27f4e2c73b442a75c9434702550.zip
24711: fix re-presentation of here-documents munged internally
to here-strings
Diffstat (limited to 'Src/zsh.h')
-rw-r--r--Src/zsh.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/Src/zsh.h b/Src/zsh.h
index fb4d51ecd..495f51ad2 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -309,7 +309,10 @@ enum {
     REDIR_OUTPIPE		/* > >(...) */
 };
 #define REDIR_TYPE_MASK	(0x1f)
+/* Redir using {var} syntax */
 #define REDIR_VARID_MASK (0x20)
+/* Mark here-string that came from a here-document */
+#define REDIR_FROM_HEREDOC_MASK (0x40)
 
 #define IS_WRITE_FILE(X)      ((X)>=REDIR_WRITE && (X)<=REDIR_READWRITE)
 #define IS_APPEND_REDIR(X)    (IS_WRITE_FILE(X) && ((X) & 2))
@@ -550,10 +553,18 @@ struct conddef {
 #define CONDDEF(name, flags, handler, min, max, condid) \
     { NULL, name, flags, handler, min, max, condid, NULL }
 
+/* Flags for redirections */
+
+enum {
+    /* Mark a here-string that came from a here-document */
+    REDIRF_FROM_HEREDOC = 1
+};
+
 /* tree element for redirection lists */
 
 struct redir {
     int type;
+    int flags;
     int fd1, fd2;
     char *name;
     char *varid;
@@ -744,6 +755,7 @@ struct eccstr {
 
 #define WC_REDIR_TYPE(C)    ((int)(wc_data(C) & REDIR_TYPE_MASK))
 #define WC_REDIR_VARID(C)   ((int)(wc_data(C) & REDIR_VARID_MASK))
+#define WC_REDIR_FROM_HEREDOC(C) ((int)(wc_data(C) & REDIR_FROM_HEREDOC_MASK))
 #define WCB_REDIR(T)        wc_bld(WC_REDIR, (T))
 /* Size of redir is 4 words if REDIR_VARID_MASK is set, else 3 */
 #define WC_REDIR_WORDS(C)   (WC_REDIR_VARID(C) ? 4 : 3)