=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/entries.c,v retrieving revision 1.6 retrieving revision 1.7 diff -c -r1.6 -r1.7 *** src/usr.bin/cvs/entries.c 2004/07/26 16:53:58 1.6 --- src/usr.bin/cvs/entries.c 2004/07/27 13:12:10 1.7 *************** *** 1,4 **** ! /* $OpenBSD: entries.c,v 1.6 2004/07/26 16:53:58 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: entries.c,v 1.7 2004/07/27 13:12:10 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 72,78 **** mode[0] = 'r'; break; case O_WRONLY: ! mode[0] = 'w'; break; } --- 72,78 ---- mode[0] = 'r'; break; case O_WRONLY: ! mode[0] = 'a'; break; } *************** *** 107,112 **** --- 107,114 ---- len = strlen(ebuf); if ((len > 0) && (ebuf[len - 1] == '\n')) ebuf[--len] = '\0'; + if (strcmp(ebuf, "D") == 0) + break; ent = cvs_ent_parse(ebuf); if (ent == NULL) continue; *************** *** 155,166 **** --- 157,170 ---- * cvs_ent_add() * * Add the entry to the Entries file . + * Returns 0 on success, or -1 on failure. */ int cvs_ent_add(CVSENTRIES *ef, struct cvs_ent *ent) { void *tmp; + char nbuf[64]; if (ef->cef_file == NULL) { cvs_log(LP_ERR, "Entries file is opened in read-only mode"); *************** *** 174,180 **** cvs_log(LP_ERRNO, "failed to seek to end of CVS/Entries file"); return (-1); } ! fprintf(ef->cef_file, "%s\n", ent->ce_line); TAILQ_INSERT_TAIL(&(ef->cef_ent), ent, ce_list); return (0); --- 178,186 ---- cvs_log(LP_ERRNO, "failed to seek to end of CVS/Entries file"); return (-1); } ! rcsnum_tostr(ent->ce_rev, nbuf, sizeof(nbuf)); ! fprintf(ef->cef_file, "/%s/%s/%s/%s/\n", ent->ce_name, nbuf, ! ent->ce_timestamp, ent->ce_opts); TAILQ_INSERT_TAIL(&(ef->cef_ent), ent, ce_list); return (0);