summaryrefslogtreecommitdiffstats
path: root/Src/text.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-06-18 10:55:45 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-06-18 10:55:45 +0000
commita2159285e80508bb682d90a71270fbddada8bd05 (patch)
treec491bf7a28d7f8fac7ab05cc860c01dea95c19b1 /Src/text.c
parentzsh-3.1.5-pws-21 (diff)
downloadzsh-a2159285e80508bb682d90a71270fbddada8bd05.tar
zsh-a2159285e80508bb682d90a71270fbddada8bd05.tar.gz
zsh-a2159285e80508bb682d90a71270fbddada8bd05.tar.bz2
zsh-a2159285e80508bb682d90a71270fbddada8bd05.tar.lz
zsh-a2159285e80508bb682d90a71270fbddada8bd05.tar.xz
zsh-a2159285e80508bb682d90a71270fbddada8bd05.tar.zst
zsh-a2159285e80508bb682d90a71270fbddada8bd05.zip
zsh-3.1.5-pws-22zsh-3.1.5-pws-22
Diffstat (limited to 'Src/text.c')
-rw-r--r--Src/text.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/Src/text.c b/Src/text.c
index d3eafaf9f..73b9088f2 100644
--- a/Src/text.c
+++ b/Src/text.c
@@ -169,7 +169,6 @@ gettext2(struct node *n)
if (_List(n)->type & Z_DISOWN)
taddstr("|");
}
- simplifyright(_List(n));
if (_List(n)->right) {
if (tnewlins)
taddnl();
@@ -460,22 +459,23 @@ getsimptext(Cmd cmd)
{
LinkNode n;
- for (n = firstnode(cmd->vars); n; incnode(n)) {
- struct varasg *v = (struct varasg *)getdata(n);
+ if (cmd->vars)
+ for (n = firstnode(cmd->vars); n; incnode(n)) {
+ struct varasg *v = (struct varasg *)getdata(n);
- taddstr(v->name);
- taddchr('=');
- if (PM_TYPE(v->type) == PM_ARRAY) {
- taddchr('(');
- taddlist(v->arr);
- taddstr(") ");
- } else if (PM_TYPE(v->type) == PM_HASHED) {
- /* XXX */
- } else {
- taddstr(v->str);
- taddchr(' ');
+ taddstr(v->name);
+ taddchr('=');
+ if (PM_TYPE(v->type) == PM_ARRAY) {
+ taddchr('(');
+ taddlist(v->arr);
+ taddstr(") ");
+ } else if (PM_TYPE(v->type) == PM_HASHED) {
+ /* XXX */
+ } else {
+ taddstr(v->str);
+ taddchr(' ');
+ }
}
- }
taddlist(cmd->args);
}
@@ -490,6 +490,8 @@ getredirs(Cmd cmd)
"<<", "<<-", "<<<", "<&", ">&", NULL /* >&- */, "<", ">"
};
+ if (!cmd->redir)
+ return;
taddchr(' ');
for (n = firstnode(cmd->redir); n; incnode(n)) {
struct redir *f = (struct redir *)getdata(n);
@@ -537,7 +539,7 @@ taddlist(LinkList l)
{
LinkNode n;
- if (!(n = firstnode(l)))
+ if (!l || !(n = firstnode(l)))
return;
for (; n; incnode(n)) {
taddstr(getdata(n));