Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Infinite loop (?) in "typeset"
- X-seq: zsh-workers 10179
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Infinite loop (?) in "typeset"
- Date: Mon, 20 Mar 2000 11:56:09 +0100 (MET)
- In-reply-to: "Bart Schaefer"'s message of Sun, 19 Mar 2000 20:59:11 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
> It seems to be trying to print out the body of the _normal function from
> the $functions assoc, but I'm not quite sure. It repeatedly executes
>
> 228 while (1) {
> 229 if (stack) {
> 230 if (!(s = tstack))
> 232 if (s->pop) {
> 237 code = s->code;
> 238 stack = 0;
> 239 } else {
> 243 switch (wc_code(code)) {
> 697 stack = 1;
> 698 break;
I couldn't reproduce it (_normal works for me). The only thing that
has changed there lately was that (..) and {..} now have a WC_END
after their bodies.
Could you try the patch below?
Bye
Sven
diff -ru ../z.old/Src/text.c Src/text.c
--- ../z.old/Src/text.c Mon Mar 20 11:28:50 2000
+++ Src/text.c Mon Mar 20 11:50:23 2000
@@ -194,6 +194,9 @@
struct {
int par;
} _cond;
+ struct {
+ Wordcode end;
+ } _subsh;
} u;
};
@@ -329,8 +332,10 @@
if (!s) {
taddstr("( ");
tindent++;
- tpush(code, 1);
+ n = tpush(code, 1);
+ n->u._subsh.end = state->pc + WC_SUBSH_SKIP(code);
} else {
+ state->pc = s->u._subsh.end;
tindent--;
taddstr(" )");
stack = 1;
@@ -340,8 +345,10 @@
if (!s) {
taddstr("{ ");
tindent++;
- tpush(code, 1);
+ n = tpush(code, 1);
+ n->u._subsh.end = state->pc + WC_CURSH_SKIP(code);
} else {
+ state->pc = s->u._subsh.end;
tindent--;
taddstr(" }");
stack = 1;
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author