diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-07-14 07:38:36 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-07-14 07:38:36 +0000 |
commit | 058b6a351bcc0711e2c67df843c2c3af79a65cb1 (patch) | |
tree | 16dc4c616c979a67943a6bc67669171645c24062 /usr.bin/cvs | |
parent | ecc7dd17d4d60d9626ff978f378db0be0933c8ed (diff) |
be consistent when declaring cvs_ent structs; ok jfb@ joris@.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/entries.c | 52 | ||||
-rw-r--r-- | usr.bin/cvs/resp.c | 20 |
2 files changed, 36 insertions, 36 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index 15bb1d9af21..659cca85117 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.38 2005/06/17 15:09:55 joris Exp $ */ +/* $OpenBSD: entries.c,v 1.39 2005/07/14 07:38:35 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -289,11 +289,11 @@ cvs_ent_remove(CVSENTRIES *ef, const char *name) struct cvs_ent* cvs_ent_get(CVSENTRIES *ef, const char *file) { - struct cvs_ent *ep; + struct cvs_ent *ent; - TAILQ_FOREACH(ep, &(ef->cef_ent), ce_list) - if (strcmp(ep->ce_name, file) == 0) - return (ep); + TAILQ_FOREACH(ent, &(ef->cef_ent), ce_list) + if (strcmp(ent->ce_name, file) == 0) + return (ent); return (NULL); } @@ -329,7 +329,7 @@ cvs_ent_parse(const char *entry) { int i; char *fields[CVS_ENTRIES_NFIELDS], *buf, *sp, *dp; - struct cvs_ent *entp; + struct cvs_ent *ent; buf = strdup(entry); if (buf == NULL) { @@ -352,53 +352,53 @@ cvs_ent_parse(const char *entry) return (NULL); } - entp = (struct cvs_ent *)malloc(sizeof(*entp)); - if (entp == NULL) { + ent = (struct cvs_ent *)malloc(sizeof(*ent)); + if (ent == NULL) { cvs_log(LP_ERRNO, "failed to allocate CVS entry"); return (NULL); } - memset(entp, 0, sizeof(*entp)); - entp->ce_buf = buf; + memset(ent, 0, sizeof(*ent)); + ent->ce_buf = buf; if (*fields[0] == '\0') - entp->ce_type = CVS_ENT_FILE; + ent->ce_type = CVS_ENT_FILE; else if (*fields[0] == 'D') - entp->ce_type = CVS_ENT_DIR; + ent->ce_type = CVS_ENT_DIR; else - entp->ce_type = CVS_ENT_NONE; + ent->ce_type = CVS_ENT_NONE; - entp->ce_status = CVS_ENT_REG; - entp->ce_name = fields[1]; + ent->ce_status = CVS_ENT_REG; + ent->ce_name = fields[1]; - if (entp->ce_type == CVS_ENT_FILE) { + if (ent->ce_type == CVS_ENT_FILE) { if (*fields[2] == '-') { - entp->ce_status = CVS_ENT_REMOVED; + ent->ce_status = CVS_ENT_REMOVED; sp = fields[2] + 1; } else { sp = fields[2]; if ((fields[2][0] == '0') && (fields[2][1] == '\0')) - entp->ce_status = CVS_ENT_ADDED; + ent->ce_status = CVS_ENT_ADDED; } - if ((entp->ce_rev = rcsnum_parse(sp)) == NULL) { - cvs_ent_free(entp); + if ((ent->ce_rev = rcsnum_parse(sp)) == NULL) { + cvs_ent_free(ent); return (NULL); } if (cvs_cmdop == CVS_OP_SERVER) { if (!strcmp(fields[3], "up to date")) - entp->ce_status = CVS_ENT_UPTODATE; + ent->ce_status = CVS_ENT_UPTODATE; } else { if (strcmp(fields[3], CVS_DATE_DUMMY) == 0) - entp->ce_mtime = CVS_DATE_DMSEC; + ent->ce_mtime = CVS_DATE_DMSEC; else - entp->ce_mtime = cvs_date_parse(fields[3]); + ent->ce_mtime = cvs_date_parse(fields[3]); } } - entp->ce_opts = fields[4]; - entp->ce_tag = fields[5]; - return (entp); + ent->ce_opts = fields[4]; + ent->ce_tag = fields[5]; + return (ent); } /* diff --git a/usr.bin/cvs/resp.c b/usr.bin/cvs/resp.c index 1638221b3f5..b5684c6209b 100644 --- a/usr.bin/cvs/resp.c +++ b/usr.bin/cvs/resp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resp.c,v 1.44 2005/07/10 00:12:52 joris Exp $ */ +/* $OpenBSD: resp.c,v 1.45 2005/07/14 07:38:35 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -624,7 +624,7 @@ cvs_resp_updated(struct cvsroot *root, int type, char *line) mode_t fmode; char path[MAXPATHLEN], cksum_buf[CVS_CKSUM_LEN]; BUF *fbuf; - struct cvs_ent *ep; + struct cvs_ent *ent; struct timeval tv[2]; STRIP_SLASH(line); @@ -637,9 +637,9 @@ cvs_resp_updated(struct cvsroot *root, int type, char *line) if (cvs_getln(root, path, sizeof(path)) < 0) return (-1); - if ((ep = cvs_ent_parse(path)) == NULL) + if ((ent = cvs_ent_parse(path)) == NULL) return (-1); - ret = snprintf(path, sizeof(path), "%s/%s", line, ep->ce_name); + ret = snprintf(path, sizeof(path), "%s/%s", line, ent->ce_name); if (ret == -1 || ret >= (int)sizeof(path)) { cvs_log(LP_ERR, "Entries path overflow in response"); return (-1); @@ -650,21 +650,21 @@ cvs_resp_updated(struct cvsroot *root, int type, char *line) return (-1); if (cvs_modtime != CVS_DATE_DMSEC) { - ep->ce_mtime = cvs_modtime; + ent->ce_mtime = cvs_modtime; } else - ep->ce_mtime = time(&(ep->ce_mtime)); + ent->ce_mtime = time(&(ent->ce_mtime)); if ((type == CVS_RESP_UPDEXIST) || (type == CVS_RESP_UPDATED) || (type == CVS_RESP_MERGED) || (type == CVS_RESP_CREATED)) { - if ((cvs_ent_remove(cvs_resp_lastent, ep->ce_name) < 0) && + if ((cvs_ent_remove(cvs_resp_lastent, ent->ce_name) < 0) && (type != CVS_RESP_CREATED)) { cvs_log(LP_WARN, "failed to remove entry for '%s`", - ep->ce_name); + ent->ce_name); } } - if (cvs_ent_add(cvs_resp_lastent, ep) < 0) { - cvs_ent_free(ep); + if (cvs_ent_add(cvs_resp_lastent, ent) < 0) { + cvs_ent_free(ent); return (-1); } |