From 2be8a851d5b5c4c64f8793f056a0d505f27d666f Mon Sep 17 00:00:00 2001 From: Brian Koropoff Date: Sat, 1 Mar 2003 02:44:58 +0000 Subject: [PATCH] Oops, make 'return' GIB builtin actually end the current function. --- include/QF/gib_buffer.h | 2 +- libs/gib/gib_buffer.c | 2 +- libs/gib/gib_builtin.c | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/QF/gib_buffer.h b/include/QF/gib_buffer.h index ef63389b0..304223515 100644 --- a/include/QF/gib_buffer.h +++ b/include/QF/gib_buffer.h @@ -48,7 +48,7 @@ typedef struct gib_buffer_data_s { struct gib_script_s *script; struct gib_tree_s *program, *ip; struct dstring_s *arg_composite; - qboolean done, waitret; + qboolean waitret; struct gib_sstack_s { struct gib_dsarray_s { struct dstring_s **dstrs; diff --git a/libs/gib/gib_buffer.c b/libs/gib/gib_buffer.c index f748a2705..f2ea1bf14 100644 --- a/libs/gib/gib_buffer.c +++ b/libs/gib/gib_buffer.c @@ -104,7 +104,7 @@ GIB_Buffer_Reset (struct cbuf_s *cbuf) g->script = 0; g->program = g->ip = 0; g->stack.p = 0; - g->waitret = g->done = false; + g->waitret = false; } diff --git a/libs/gib/gib_builtin.c b/libs/gib/gib_builtin.c index 131939e83..b0917baaf 100644 --- a/libs/gib/gib_builtin.c +++ b/libs/gib/gib_builtin.c @@ -278,12 +278,14 @@ GIB_Domain_Clear_f (void) Hash_FlushTable (GIB_Domain_Get (GIB_Argv (2))); } +static gib_tree_t fakeip = {0,0,0,0,0,0,0,0}; + static void GIB_Return_f (void) { cbuf_t *sp = cbuf_active->up; - GIB_DATA (cbuf_active)->done = true; + GIB_DATA (cbuf_active)->ip = &fakeip; if (GIB_Argc () > 1 && sp && sp->interpreter == &gib_interp && GIB_DATA (sp)->waitret) {