# HG changeset patch # User Francesco Potort # Date 1018915375 0 # Node ID 5adf2b1c20bbb709deb75b8cfd00585073db5123 # Parent a24a2c25aea532d4d48dcf486875235be20e5605 (find_entries): Bug fix in list management. diff -r a24a2c25aea5 -r 5adf2b1c20bb lib-src/etags.c --- a/lib-src/etags.c Tue Apr 16 00:02:38 2002 +0000 +++ b/lib-src/etags.c Tue Apr 16 00:02:55 2002 +0000 @@ -33,7 +33,7 @@ * Francesco Potort has maintained it since 1993. */ -char pot_etags_version[] = "@(#) pot revision number is 15.13"; +char pot_etags_version[] = "@(#) pot revision number is 15.15"; #define TRUE 1 #define FALSE 0 @@ -1530,10 +1530,18 @@ if (retval < 0) pfatal (file); + /* If not Ctags, and if this is not metasource and if it contained no #line + directives, we can write the tags and free curfdp an all nodes pointing to + it. */ + if (!CTAGS + && curfdp == fdhead /* no #line directives in this file */ + && !curfdp->lang->metasource) + { + /* Write tags for file curfdp->taggedfname. */ + ; + } + cleanup: - /* Memory leak here: if this is not metasource and if it contained no #line - directives, curfdp could be freed, and so could all nodes pointing to it - if not CTAGS. */ if (compressed_name) free (compressed_name); if (uncompressed_name) free (uncompressed_name); return; @@ -1663,9 +1671,6 @@ { fdesc *badfdp = *fdpp; - *fdpp = badfdp->next; /* remove the bad description from the list */ - fdpp = &badfdp->next; /* advance the list pointer */ - if (DEBUG) fprintf (stderr, "Removing references to \"%s\" obtained from \"%s\"\n", @@ -1674,6 +1679,8 @@ /* Delete the tags referring to badfdp. */ invalidate_nodes (badfdp, nodehead); + *fdpp = badfdp->next; /* remove the bad description from the list */ + /* Delete badfdp. */ if (badfdp->infname != NULL) free (badfdp->infname); if (badfdp->infabsname != NULL) free (badfdp->infabsname);