=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/version.c,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** src/usr.bin/cvs/version.c 2004/07/29 18:23:25 1.3 --- src/usr.bin/cvs/version.c 2004/07/30 01:49:25 1.4 *************** *** 1,4 **** ! /* $OpenBSD: version.c,v 1.3 2004/07/29 18:23:25 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: version.c,v 1.4 2004/07/30 01:49:25 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 34,65 **** #include #include "cvs.h" int cvs_version(int argc, char **argv) { if (argc > 1) return (EX_USAGE); ! cvs_root = cvsroot_get("."); ! ! if ((cvs_root) && (cvs_root->cr_method != CVS_METHOD_LOCAL)) printf("Client: "); - printf("%s\n", CVS_VERSION); ! ! if ((cvs_root) && (cvs_root->cr_method != CVS_METHOD_LOCAL)) ! if (cvs_client_connect(cvs_root) < 0) return (1); - if ((cvs_root) && (cvs_root->cr_method != CVS_METHOD_LOCAL)) { printf("Server: "); ! cvs_client_sendreq(CVS_REQ_VERSION, NULL, 1); ! cvs_client_disconnect(cvs_root); } return (0); } --- 34,66 ---- #include #include "cvs.h" + #include "proto.h" int cvs_version(int argc, char **argv) { + struct cvsroot *root; + if (argc > 1) return (EX_USAGE); ! root = cvsroot_get("."); ! if ((root != NULL) && (root->cr_method != CVS_METHOD_LOCAL)) printf("Client: "); printf("%s\n", CVS_VERSION); ! if ((root != NULL) && (root->cr_method != CVS_METHOD_LOCAL)) { ! if (cvs_connect(root) < 0) return (1); printf("Server: "); ! cvs_sendreq(root, CVS_REQ_VERSION, NULL); ! cvs_disconnect(root); } + + cvsroot_free(root); return (0); }