=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/Attic/resp.c,v retrieving revision 1.15 retrieving revision 1.16 diff -c -r1.15 -r1.16 *** src/usr.bin/cvs/Attic/resp.c 2004/12/08 20:00:23 1.15 --- src/usr.bin/cvs/Attic/resp.c 2004/12/10 18:47:38 1.16 *************** *** 1,4 **** ! /* $OpenBSD: resp.c,v 1.15 2004/12/08 20:00:23 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: resp.c,v 1.16 2004/12/10 18:47:38 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 36,41 **** --- 36,42 ---- #include #include #include + #include #include #include "buf.h" *************** *** 499,511 **** static int cvs_resp_copyfile(struct cvsroot *root, int type, char *line) { ! char newname[MAXNAMLEN]; ! /* read the new file name given by the server */ ! if (cvs_getln(root, newname, sizeof(newname)) < 0) return (-1); ! if (rename(line, newname) == -1) { cvs_log(LP_ERRNO, "failed to rename %s to %s", line, newname); return (-1); } --- 500,521 ---- static int cvs_resp_copyfile(struct cvsroot *root, int type, char *line) { ! char path[MAXPATHLEN], newpath[MAXPATHLEN], newname[MAXNAMLEN], *file; ! /* read the remote path of the file to copy and its new name */ ! if ((cvs_getln(root, path, sizeof(path)) < 0) || ! (cvs_getln(root, newname, sizeof(newname)) < 0)) return (-1); ! if ((file = basename(path)) == NULL) { ! cvs_log(LP_ERR, "no base file name in Copy-file path"); ! return (-1); ! } ! ! snprintf(path, sizeof(path), "%s%s", line, file); ! snprintf(newpath, sizeof(newpath), "%s%s", line, newname); ! ! if (rename(path, newpath) == -1) { cvs_log(LP_ERRNO, "failed to rename %s to %s", line, newname); return (-1); }