=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/Attic/proto.c,v retrieving revision 1.14 retrieving revision 1.15 diff -c -r1.14 -r1.15 *** src/usr.bin/cvs/Attic/proto.c 2004/07/30 17:37:58 1.14 --- src/usr.bin/cvs/Attic/proto.c 2004/07/30 23:10:21 1.15 *************** *** 1,4 **** ! /* $OpenBSD: proto.c,v 1.14 2004/07/30 17:37:58 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: proto.c,v 1.15 2004/07/30 23:10:21 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 176,183 **** { CVS_RESP_CREATED, "Created", cvs_resp_updated }, { CVS_RESP_UPDATED, "Updated", cvs_resp_updated }, { CVS_RESP_UPDEXIST, "Update-existing", cvs_resp_updated }, { CVS_RESP_REMOVED, "Removed", cvs_resp_removed }, - { CVS_RESP_MERGED, "Merged", NULL }, { CVS_RESP_CKSUM, "Checksum", cvs_resp_cksum }, { CVS_RESP_CLRSTATDIR, "Clear-static-directory", cvs_resp_statdir }, { CVS_RESP_SETSTATDIR, "Set-static-directory", cvs_resp_statdir }, --- 176,183 ---- { CVS_RESP_CREATED, "Created", cvs_resp_updated }, { CVS_RESP_UPDATED, "Updated", cvs_resp_updated }, { CVS_RESP_UPDEXIST, "Update-existing", cvs_resp_updated }, + { CVS_RESP_MERGED, "Merged", cvs_resp_updated }, { CVS_RESP_REMOVED, "Removed", cvs_resp_removed }, { CVS_RESP_CKSUM, "Checksum", cvs_resp_cksum }, { CVS_RESP_CLRSTATDIR, "Clear-static-directory", cvs_resp_statdir }, { CVS_RESP_SETSTATDIR, "Set-static-directory", cvs_resp_statdir }, *************** *** 819,829 **** static int cvs_resp_newentry(struct cvsroot *root, int type, char *line) { ! char entbuf[128], path[MAXPATHLEN]; CVSENTRIES *entfile; - snprintf(path, sizeof(path), "%s/" CVS_PATH_ENTRIES, line); - /* get the remote path */ cvs_getln(root, entbuf, sizeof(entbuf)); --- 819,827 ---- static int cvs_resp_newentry(struct cvsroot *root, int type, char *line) { ! char entbuf[128]; CVSENTRIES *entfile; /* get the remote path */ cvs_getln(root, entbuf, sizeof(entbuf)); *************** *** 831,837 **** if (cvs_getln(root, entbuf, sizeof(entbuf)) < 0) return (-1); ! entfile = cvs_ent_open(path, O_WRONLY); if (entfile == NULL) return (-1); cvs_ent_addln(entfile, entbuf); --- 829,835 ---- if (cvs_getln(root, entbuf, sizeof(entbuf)) < 0) return (-1); ! entfile = cvs_ent_open(line, O_WRONLY); if (entfile == NULL) return (-1); cvs_ent_addln(entfile, entbuf); *************** *** 953,975 **** ep = NULL; ! if (type == CVS_RESP_CREATED) { ! /* read the remote path of the file */ ! cvs_getln(root, path, sizeof(path)); ! /* read the new entry */ ! cvs_getln(root, path, sizeof(path)); ! ep = cvs_ent_parse(path); ! if (ep == NULL) ! return (-1); ! snprintf(path, sizeof(path), "%s%s", line, ep->ce_name); /* set the timestamp as the last one received from Mod-time */ ep->ce_timestamp = ctime_r(&cvs_modtime, tbuf); - len = strlen(tbuf); - if ((len > 0) && (tbuf[len - 1] == '\n')) - tbuf[--len] = '\0'; ef = cvs_ent_open(line, O_WRONLY); if (ef == NULL) --- 951,974 ---- ep = NULL; ! len = strlen(tbuf); ! if ((len > 0) && (tbuf[len - 1] == '\n')) ! tbuf[--len] = '\0'; ! /* read the remote path of the file */ ! cvs_getln(root, path, sizeof(path)); ! /* read the new entry */ ! cvs_getln(root, path, sizeof(path)); ! ep = cvs_ent_parse(path); ! if (ep == NULL) ! return (-1); ! snprintf(path, sizeof(path), "%s/%s", line, ep->ce_name); + + if (type == CVS_RESP_CREATED) { /* set the timestamp as the last one received from Mod-time */ ep->ce_timestamp = ctime_r(&cvs_modtime, tbuf); ef = cvs_ent_open(line, O_WRONLY); if (ef == NULL) *************** *** 1070,1076 **** if (fname == NULL) fname = buf; snprintf(file, sizeof(file), "%s%s", line, fname); - printf("FILE TO PATCH: %s\n", file); /* get updated entry fields */ cvs_getln(root, buf, sizeof(buf)); --- 1069,1074 ----