Always clear the rcsbuf cache before exiting. This is required for when CVS is used as a DLL, as otherwise the RCS file will remain open, causing later modifications to the file to mysteriously fail. This is also a descriptor leak, and some OSs may not like it very much... diff -r -u cvs-1.10.8-cvsnt/src/main.c cvs-1.10.8-New/src/main.c --- cvs-1.10.8-cvsnt/src/main.c Mon Apr 02 08:49:29 2001 +++ cvs-1.10.8-New/src/main.c Tue Mar 20 09:28:46 2001 @@ -1100,7 +1100,8 @@ NT and OS2 or dealing with windows and arguments on Mac. */ SYSTEM_CLEANUP (); #endif + rcsbuf_cache_close (); + /* This is exit rather than return because apparently that keeps some tools which check for memory leaks happier. */ exit (err ? EXIT_FAILURE : 0); diff -r -u cvs-1.10.8-cvsnt/src/rcs.c cvs-1.10.8-New/src/rcs.c --- cvs-1.10.8-cvsnt/src/rcs.c Mon Apr 02 08:49:29 2001 +++ cvs-1.10.8-New/src/rcs.c Tue Mar 20 08:58:30 2001 @@ -70,7 +70,6 @@ static void rcsbuf_get_buffered PROTO ((struct rcsbuffer *, char **datap, size_t *lenp)); static void rcsbuf_cache PROTO ((RCSNode *, struct rcsbuffer *)); -static void rcsbuf_cache_close PROTO ((void)); static void rcsbuf_cache_open PROTO ((RCSNode *, long, FILE **, struct rcsbuffer *)); static int checkmagic_proc PROTO((Node *p, void *closure)); @@ -2235,7 +2235,7 @@ /* If there is anything in the cache, close it. */ -static void +void rcsbuf_cache_close () { if (cached_rcs != NULL) diff -r -u cvs-1.10.8-cvsnt/src/rcs.h cvs-1.10.8-New/src/rcs.h --- cvs-1.10.8-cvsnt/src/rcs.h Fri Jan 29 20:25:34 1999 +++ cvs-1.10.8-New/src/rcs.h Tue Mar 20 08:58:28 2001 @@ -232,6 +232,8 @@ size_t, char **, size_t *)); char *make_file_label PROTO ((char *, char *, RCSNode *)); +void rcsbuf_cache_close PROTO ((void)); + extern int preserve_perms; /* From import.c. */