From c6dd1e63a951ba4b529ed292f88fba28de70df78 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 11 Aug 1998 18:33:37 +0000 Subject: This one cleans the cursor problems ecpg had so far. It is now able to understand cursors with variables. Michael --- src/interfaces/ecpg/preproc/ecpg.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/interfaces/ecpg/preproc/ecpg.c') diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index f12b799850..1fe777845b 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -23,6 +23,7 @@ extern char *optarg; struct _include_path *include_paths; static int no_auto_trans = 0; +struct cursor *cur = NULL; static void usage(char *progname) @@ -138,6 +139,24 @@ main(int argc, char *const argv[]) { struct cursor *ptr; + /* remove old cursor definitions if any are still there */ + for (ptr = cur; ptr != NULL; ptr=ptr->next) + { + struct arguments *l1, *l2; + + free(ptr->command); + free(ptr->name); + for (l1 = argsinsert; l1; l1 = l2) + { + l2 = l1->next; + free(l1); + } + for (l1 = argsresult; l1; l1 = l2) + { + l2 = l1->next; + free(l1); + } + } /* initialize lex */ lex_init(); -- cgit v1.2.1