From a6ebb030f4670cdeae6cc724ffdfadf11942074a Mon Sep 17 00:00:00 2001 From: Jean-Francois Brousseau Date: Fri, 16 Jul 2004 03:08:27 +0000 Subject: * add prototypes for cvs_getargv() and cvs_freeargv() * remove cvs_file_free(), cvs_freeargv() does exactly the same --- usr.bin/cvs/cvs.h | 5 +++-- usr.bin/cvs/file.c | 22 +++------------------- 2 files changed, 6 insertions(+), 21 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index f080e5e1046..54778b82833 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.h,v 1.5 2004/07/14 19:08:48 jfb Exp $ */ +/* $OpenBSD: cvs.h,v 1.6 2004/07/16 03:08:26 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -350,7 +350,6 @@ int cvs_file_init (void); int cvs_file_ignore (const char *); int cvs_file_isignored (const char *); char** cvs_file_getv (const char *, int *); -void cvs_file_free (char **, int); /* Entries API */ @@ -378,6 +377,8 @@ int cvs_modetostr (mode_t, char *, size_t); int cvs_strtomode (const char *, mode_t *); int cvs_cksum (const char *, char *, size_t); int cvs_exec (int, char **, int []); +int cvs_getargv (const char *, char **, int); +void cvs_freeargv (char **, int); #endif /* CVS_H */ diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index 0e01d971d12..f34b86f9028 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.1 2004/07/14 03:33:09 jfb Exp $ */ +/* $OpenBSD: file.c,v 1.2 2004/07/16 03:08:26 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -207,7 +207,8 @@ cvs_file_isignored(const char *file) * matching any of the ignore patterns. The number of files found is * returned in . * Returns a pointer to a dynamically-allocated string vector on success, - * or NULL on failure. + * or NULL on failure. The returned vector should be freed with + * cvs_freeargv(). */ char** @@ -259,20 +260,3 @@ cvs_file_getv(const char *dir, int *nfiles) return (fvec); } - - -/* - * cvs_file_freev() - * - * Free a file vector obtained with cvs_file_getv(). - */ - -void -cvs_file_freev(char **fvec, int nfiles) -{ - int i; - - for (i = 0; i < nfiles; i++) - free(fvec[i]); - free(fvec); -} -- cgit v1.2.3