diff options
author | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2005-05-26 21:25:50 +0000 |
---|---|---|
committer | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2005-05-26 21:25:50 +0000 |
commit | 00efa8caa08bfb6f5b14c5016e02c3a2b1cef050 (patch) | |
tree | 00ccefe398fdd80cddfc3fccb9ddfb98d58e1b55 /usr.bin/cvs | |
parent | 3efe855390fa1ce23514514f2a940e64a3287718 (diff) |
- remove cvs_ent_getent(), it's not used anymore
- don't use strcmp() to compare one-character strings
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/cvs.h | 3 | ||||
-rw-r--r-- | usr.bin/cvs/entries.c | 39 |
2 files changed, 4 insertions, 38 deletions
diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index 579f5b52b8c..16e5b4f9508 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.h,v 1.60 2005/05/26 03:07:20 joris Exp $ */ +/* $OpenBSD: cvs.h,v 1.61 2005/05/26 21:25:49 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -369,7 +369,6 @@ int cvs_ent_write (CVSENTRIES *); struct cvs_ent* cvs_ent_parse (const char *); void cvs_ent_close (CVSENTRIES *); void cvs_ent_free (struct cvs_ent *); -struct cvs_ent* cvs_ent_getent (const char *); /* history API */ CVSHIST* cvs_hist_open (const char *); diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index abd983ce057..df5427356b3 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.30 2005/05/24 04:12:25 jfb Exp $ */ +/* $OpenBSD: entries.c,v 1.31 2005/05/26 21:25:49 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -118,7 +118,7 @@ cvs_ent_open(const char *dir, int flags) len = strlen(ebuf); if ((len > 0) && (ebuf[len - 1] == '\n')) ebuf[--len] = '\0'; - if (strcmp(ebuf, "D") == 0) + if ((ebuf[0] == 'D') && (ebuf[1] == '\0')) break; ent = cvs_ent_parse(ebuf); if (ent == NULL) @@ -366,7 +366,7 @@ cvs_ent_parse(const char *entry) sp = fields[2] + 1; } else { sp = fields[2]; - if (strcmp(fields[2], "0") == 0) + if ((fields[2][0] == '0') && (fields[2][1] == '\0')) entp->ce_status = CVS_ENT_ADDED; } if ((entp->ce_rev = rcsnum_parse(sp)) == NULL) { @@ -385,7 +385,6 @@ cvs_ent_parse(const char *entry) return (entp); } - /* * cvs_ent_free() * @@ -401,38 +400,6 @@ cvs_ent_free(struct cvs_ent *ent) free(ent); } - -/* - * cvs_ent_getent() - * - * Get a single entry from the CVS/Entries file of the basename portion of - * path <path> and return that entry. That entry must later be freed using - * cvs_ent_free(). - */ -struct cvs_ent* -cvs_ent_getent(const char *path) -{ - char base[MAXPATHLEN], *file; - CVSENTRIES *entf; - struct cvs_ent *ep; - - cvs_splitpath(path, base, sizeof(base), &file); - - entf = cvs_ent_open(base, O_RDONLY); - if (entf == NULL) - return (NULL); - - ep = cvs_ent_get(entf, file); - if (ep != NULL) { - /* take it out of the queue so it doesn't get freed */ - TAILQ_REMOVE(&(entf->cef_ent), ep, ce_list); - } - - cvs_ent_close(entf); - return (ep); -} - - /* * cvs_ent_write() * |