From 1dbb3e53b531febbf118b31d66a0fbd687ff16fa Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 19 Feb 2004 05:33:11 +0000 Subject: [PATCH] Prevent procedure() from being called recursively. --- src/ChangeLog | 4 ++++ src/vfm.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 7c180a6d..4f4f3eda 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +Wed Feb 18 21:32:44 2004 Ben Pfaff + + * vfm.c: (procedure) Add check to prevent recursive call. + Wed Feb 18 21:48:54 WST 2004 John Darrington * Moved the declarations relating to values to their own header file diff --git a/src/vfm.c b/src/vfm.c index e9c7d204..fb8c5feb 100644 --- a/src/vfm.c +++ b/src/vfm.c @@ -126,9 +126,13 @@ procedure (void (*beginfunc) (void *), void (*endfunc) (void *), void *aux) { + static int recursive_call; + struct write_case_data procedure_write_data; struct write_case_data split_file_data; + assert (++recursive_call == 1); + if (dict_get_split_cnt (default_dict) == 0) { /* Normally we just use the data passed by the user. */ @@ -156,6 +160,8 @@ procedure (void (*beginfunc) (void *), open_active_file (); vfm_source->read (procedure_write_case, &procedure_write_data); close_active_file (&procedure_write_data); + + assert (--recursive_call == 0); } /* Active file processing support. Subtly different semantics from -- 2.30.2