summaryrefslogtreecommitdiff
path: root/sys/src/cmd/rc/pcmd.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2020-11-01 11:56:26 -0800
committerOri Bernstein <ori@eigenstate.org>2020-11-01 11:56:26 -0800
commitd75d842cf576cb4785f89c5f5b73a4f73170001b (patch)
tree008a1cd386c97ee735ab2e1129eeda890093bcef /sys/src/cmd/rc/pcmd.c
parentdbd54342fd66fd372f5c2edd1597019814f41c9c (diff)
rc: show line numbers on error
This change provides a location for errors like 'null list in concatenation'.
Diffstat (limited to 'sys/src/cmd/rc/pcmd.c')
-rw-r--r--sys/src/cmd/rc/pcmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/cmd/rc/pcmd.c b/sys/src/cmd/rc/pcmd.c
index 51370ac23..8061669e2 100644
--- a/sys/src/cmd/rc/pcmd.c
+++ b/sys/src/cmd/rc/pcmd.c
@@ -1,7 +1,7 @@
#include "rc.h"
#include "io.h"
#include "fns.h"
-char nl='\n'; /* change to semicolon for bourne-proofing */
+
#define c0 t->child[0]
#define c1 t->child[1]
#define c2 t->child[2]
@@ -76,7 +76,7 @@ pcmd(io *f, tree *t)
case ';':
if(c0){
if(c1)
- pfmt(f, "%t%c%t", c0, nl, c1);
+ pfmt(f, "%t\n%t", c0, c1);
else pfmt(f, "%t", c0);
}
else pfmt(f, "%t", c1);