=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/util.c,v retrieving revision 1.119 retrieving revision 1.120 diff -c -r1.119 -r1.120 *** src/usr.bin/cvs/util.c 2007/09/22 16:01:22 1.119 --- src/usr.bin/cvs/util.c 2007/10/05 19:28:23 1.120 *************** *** 1,4 **** ! /* $OpenBSD: util.c,v 1.119 2007/09/22 16:01:22 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * Copyright (c) 2005, 2006 Joris Vink --- 1,4 ---- ! /* $OpenBSD: util.c,v 1.120 2007/10/05 19:28:23 gilles Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * Copyright (c) 2005, 2006 Joris Vink *************** *** 585,592 **** if ((fp = fopen(CVS_PATH_REPOSITORY, "r")) != NULL) { if ((fgets(repo, sizeof(repo), fp)) == NULL) fatal("cvs_mkpath: bad repository file"); ! if ((len = strlen(repo)) && repo[len - 1] == '\n') ! repo[len - 1] = '\0'; (void)fclose(fp); } } --- 585,591 ---- if ((fp = fopen(CVS_PATH_REPOSITORY, "r")) != NULL) { if ((fgets(repo, sizeof(repo), fp)) == NULL) fatal("cvs_mkpath: bad repository file"); ! repo[strcspn(repo, "\n")] = '\0'; (void)fclose(fp); } }