From 7ce1d5735832e51bc13e255f2e8549873c9688ff Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 5 Sep 2008 09:05:21 +0000 Subject: 25615: $ZSH_DEBUG_CMD for use in DEBUG traps --- Src/text.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Src/text.c') diff --git a/Src/text.c b/Src/text.c index 7fdc5757f..eabb51268 100644 --- a/Src/text.c +++ b/Src/text.c @@ -135,7 +135,6 @@ getpermtext(Eprog prog, Wordcode c) tbuf = (char *)zalloc(tsiz = 32); tptr = tbuf; tlim = tbuf + tsiz; - tindent = 1; tjob = 0; if (prog->len) gettext2(&s); @@ -167,7 +166,6 @@ getjobtext(Eprog prog, Wordcode c) tbuf = NULL; tptr = jbuf; tlim = tptr + JOBTEXTSIZE - 1; - tindent = 1; tjob = 1; gettext2(&s); *tptr = '\0'; @@ -247,6 +245,16 @@ gettext2(Estate state) int stack = 0; wordcode code; + /* + * Hack for parsing "simple" format of function definitions. + * In this case there is no surrounding context so the initial + * indent should be zero. + */ + if (wc_code(*state->pc) == WC_FUNCDEF) + tindent = 0; + else + tindent = 1; + while (1) { if (stack) { if (!(s = tstack)) -- cgit 1.4.1