shithub: riscv

Download patch

ref: 94bd7700aa616590ea7cedbe68c6b26f36b4231d
parent: 7734749e8a7391f4e69281fc35e48df22c9a08a4
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Apr 18 14:20:34 EDT 2020

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.

--- a/sys/src/cmd/rc/pcmd.c
+++ b/sys/src/cmd/rc/pcmd.c
@@ -106,6 +106,7 @@
 		break;
 	case PIPEFD:
 	case REDIR:
+		pchr(f, ' ');
 		switch(t->rtype){
 		case HERE:
 			pchr(f, '<');