summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-04-18 18:20:34 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2020-04-18 18:20:34 +0200
commit94bd7700aa616590ea7cedbe68c6b26f36b4231d (patch)
treedc67e946d8c13f1e1f83c46d18332d62f717f1da
parent7734749e8a7391f4e69281fc35e48df22c9a08a4 (diff)
rc: fix code serialization for PIPEFD (thanks BurnZeZ)
BurnZeZ reported this the other day. It seems like if we have a pipeline that looks like: fn foo{cat < <{echo hi}} then the '<' will get merged in /env/'fn#foo'. This change fixes pcmd to add a space. It looks to me like this is the only token that can get merged this way by pcmd.
-rw-r--r--sys/src/cmd/rc/pcmd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/src/cmd/rc/pcmd.c b/sys/src/cmd/rc/pcmd.c
index 889892370..51370ac23 100644
--- a/sys/src/cmd/rc/pcmd.c
+++ b/sys/src/cmd/rc/pcmd.c
@@ -106,6 +106,7 @@ pcmd(io *f, tree *t)
break;
case PIPEFD:
case REDIR:
+ pchr(f, ' ');
switch(t->rtype){
case HERE:
pchr(f, '<');