=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rcs/rcsprog.c,v retrieving revision 1.80 retrieving revision 1.81 diff -c -r1.80 -r1.81 *** src/usr.bin/rcs/rcsprog.c 2006/03/21 02:45:09 1.80 --- src/usr.bin/rcs/rcsprog.c 2006/03/21 02:50:15 1.81 *************** *** 1,4 **** ! /* $OpenBSD: rcsprog.c,v 1.80 2006/03/21 02:45:09 ray Exp $ */ /* * Copyright (c) 2005 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: rcsprog.c,v 1.81 2006/03/21 02:50:15 ray Exp $ */ /* * Copyright (c) 2005 Jean-Francois Brousseau * All rights reserved. *************** *** 319,325 **** break; } } - xfree(suffixes); /* * If `ret' is still NULL no RCS file with any extension exists --- 319,324 ---- *************** *** 327,349 **** */ if (ret == NULL) { /* ! * XXX - We shouldn't need to do strsep again, ! * suffixes should now be NUL separated. */ ! next = suffixes = xstrdup(rcs_suffixes); ! /* Get first extension again. */ ! if ((ext = strsep(&next, "/")) == NULL) { xfree(suffixes); return (NULL); } - if (strlcat(rcspath, ext, sizeof(rcspath)) >= sizeof(rcspath)) { - xfree(suffixes); - return (NULL); - } ret = xstrdup(rcspath); - xfree(suffixes); } return (ret); } --- 326,342 ---- */ if (ret == NULL) { /* ! * `suffixes' should now be NUL separated, so the first ! * extension can be read just by reading `suffixes'. */ ! if (strlcat(rcspath, suffixes, sizeof(rcspath)) >= sizeof(rcspath)) { xfree(suffixes); return (NULL); } ret = xstrdup(rcspath); } + xfree(suffixes); return (ret); }