Date: Sun, 11 Sep 2016 15:55:12 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r305694 - vendor/OpenBSD/dist/usr.bin/rcs Message-ID: <201609111555.u8BFtCRY051694@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Sun Sep 11 15:55:11 2016 New Revision: 305694 URL: https://svnweb.freebsd.org/changeset/base/305694 Log: Update OpenRCS to version 20160831 Obtained from: OpenBSD Modified: vendor/OpenBSD/dist/usr.bin/rcs/buf.c vendor/OpenBSD/dist/usr.bin/rcs/ci.c vendor/OpenBSD/dist/usr.bin/rcs/co.c vendor/OpenBSD/dist/usr.bin/rcs/date.y vendor/OpenBSD/dist/usr.bin/rcs/diff.c vendor/OpenBSD/dist/usr.bin/rcs/diff3.c vendor/OpenBSD/dist/usr.bin/rcs/ident.c vendor/OpenBSD/dist/usr.bin/rcs/merge.c vendor/OpenBSD/dist/usr.bin/rcs/rcs.1 vendor/OpenBSD/dist/usr.bin/rcs/rcs.c vendor/OpenBSD/dist/usr.bin/rcs/rcs.h vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.c vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.c vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.c vendor/OpenBSD/dist/usr.bin/rcs/rcsnum.c vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.c vendor/OpenBSD/dist/usr.bin/rcs/rcsprog.c vendor/OpenBSD/dist/usr.bin/rcs/rcstime.c vendor/OpenBSD/dist/usr.bin/rcs/rcsutil.c vendor/OpenBSD/dist/usr.bin/rcs/rcsutil.h vendor/OpenBSD/dist/usr.bin/rcs/rlog.1 vendor/OpenBSD/dist/usr.bin/rcs/rlog.c vendor/OpenBSD/dist/usr.bin/rcs/worklist.c vendor/OpenBSD/dist/usr.bin/rcs/xmalloc.c vendor/OpenBSD/dist/usr.bin/rcs/xmalloc.h Modified: vendor/OpenBSD/dist/usr.bin/rcs/buf.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/buf.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/buf.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.24 2015/02/05 12:59:58 millert Exp $ */ +/* $OpenBSD: buf.c,v 1.26 2015/11/02 16:45:21 nicm Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -32,6 +32,7 @@ #include <fcntl.h> #include <stdint.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <unistd.h> @@ -137,15 +138,16 @@ out: void buf_free(BUF *b) { - if (b->cb_buf != NULL) - xfree(b->cb_buf); - xfree(b); + if (b == NULL) + return; + free(b->cb_buf); + free(b); } /* * Free the buffer <b>'s structural information but do not free the contents * of the buffer. Instead, they are returned and should be freed later using - * xfree(). + * free(). */ void * buf_release(BUF *b) @@ -153,7 +155,7 @@ buf_release(BUF *b) void *tmp; tmp = b->cb_buf; - xfree(b); + free(b); return (tmp); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/ci.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/ci.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/ci.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.219 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: ci.c,v 1.224 2016/07/04 01:39:12 millert Exp $ */ /* * Copyright (c) 2005, 2006 Niall O'Higgins <niallo@openbsd.org> * All rights reserved. @@ -210,8 +210,7 @@ checkin_main(int argc, char **argv) printf("%s\n", rcs_version); exit(0); case 'w': - if (pb.author != NULL) - xfree(pb.author); + free(pb.author); pb.author = xstrdup(rcs_optarg); break; case 'x': @@ -280,7 +279,7 @@ checkin_main(int argc, char **argv) errx(1, "failed to open rcsfile `%s'", pb.fpath); if ((pb.flags & DESCRIPTION) && - rcs_set_description(pb.file, pb.description) == -1) + rcs_set_description(pb.file, pb.description, pb.flags) == -1) err(1, "%s", pb.filename); if (!(pb.flags & QUIET)) @@ -370,16 +369,11 @@ checkin_diff_file(struct checkin_params return (b3); out: - if (b1 != NULL) - buf_free(b1); - if (b2 != NULL) - buf_free(b2); - if (b3 != NULL) - buf_free(b3); - if (path1 != NULL) - xfree(path1); - if (path2 != NULL) - xfree(path2); + buf_free(b1); + buf_free(b2); + buf_free(b3); + free(path1); + free(path2); return (NULL); } @@ -412,7 +406,7 @@ checkin_getlogmsg(RCSNUM *rev, RCSNUM *r (void)fprintf(stderr, "new revision: %s; " "previous revision: %s\n", nrev, prev); - rcs_msg = rcs_prompt(prompt); + rcs_msg = rcs_prompt(prompt, flags); return (rcs_msg); } @@ -511,7 +505,7 @@ checkin_update(struct checkin_params *pb fprintf(stderr, "reuse log message of previous file? [yn](y): "); if (rcs_yesno('y') != 'y') { - xfree(pb->rcs_msg); + free(pb->rcs_msg); pb->rcs_msg = NULL; } } @@ -584,7 +578,7 @@ checkin_update(struct checkin_params *pb pb->username, pb->author, NULL, NULL); if ((pb->flags & INTERACTIVE) && (pb->rcs_msg[0] == '\0')) { - xfree(pb->rcs_msg); /* free empty log message */ + free(pb->rcs_msg); /* free empty log message */ pb->rcs_msg = NULL; } @@ -627,7 +621,7 @@ checkin_init(struct checkin_params *pb) /* Get description from user */ if (pb->description == NULL && - rcs_set_description(pb->file, NULL) == -1) { + rcs_set_description(pb->file, NULL, pb->flags) == -1) { warn("%s", pb->filename); return (-1); } @@ -734,7 +728,7 @@ checkin_attach_symbol(struct checkin_par } } } - if ((ret = rcs_sym_add(pb->file, pb->symbol, pb->newrev) == -1) && + if ((ret = rcs_sym_add(pb->file, pb->symbol, pb->newrev)) == -1 && (rcs_errno == RCS_ERR_DUPENT)) { rcsnum_tostr(rcs_sym_getrev(pb->file, pb->symbol), rbuf, sizeof(rbuf)); @@ -988,25 +982,22 @@ checkin_parsekeyword(char *keystring, RC (void)xasprintf(&datestring, "%s %s", tokens[3], tokens[4]); if ((*date = date_parse(datestring)) == -1) errx(1, "could not parse date"); - xfree(datestring); + free(datestring); if (i < 6) break; - if (*author != NULL) - xfree(*author); + free(*author); *author = xstrdup(tokens[5]); if (i < 7) break; - if (*state != NULL) - xfree(*state); + free(*state); *state = xstrdup(tokens[6]); break; case KW_TYPE_AUTHOR: if (i < 2) break; - if (*author != NULL) - xfree(*author); + free(*author); *author = xstrdup(tokens[1]); break; case KW_TYPE_DATE: @@ -1015,13 +1006,12 @@ checkin_parsekeyword(char *keystring, RC (void)xasprintf(&datestring, "%s %s", tokens[1], tokens[2]); if ((*date = date_parse(datestring)) == -1) errx(1, "could not parse date"); - xfree(datestring); + free(datestring); break; case KW_TYPE_STATE: if (i < 2) break; - if (*state != NULL) - xfree(*state); + free(*state); *state = xstrdup(tokens[1]); break; case KW_TYPE_REVISION: Modified: vendor/OpenBSD/dist/usr.bin/rcs/co.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/co.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/co.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: co.c,v 1.120 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: co.c,v 1.122 2015/10/21 16:06:57 millert Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -515,7 +515,7 @@ checkout_err_nobranch(RCSFILE *file, con file->rf_path, date ? " a date before " : "", date ? date : "", - author ? " and author " + (date ? 0:4 ) : "", + author ? " and author " + (date ? 0:4) : "", author ? author : "", state ? " and state " + (date || author ? 0:4) : "", state ? state : ""); @@ -554,7 +554,7 @@ checkout_file_has_diffs(RCSFILE *rfp, RC buf_free(bp); unlink(tempfile); - xfree(tempfile); + free(tempfile); return (ret); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/date.y ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/date.y Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/date.y Sun Sep 11 15:55:11 2016 (r305694) @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: date.y,v 1.12 2013/12/03 00:21:49 deraadt Exp $ */ +/* $OpenBSD: date.y,v 1.14 2016/08/26 09:02:54 guenther Exp $ */ /* ** Originally written by Steven M. Bellovin <smb@research.att.com> while @@ -17,6 +17,7 @@ #include <ctype.h> #include <err.h> #include <string.h> +#include <time.h> #include "rcsprog.h" @@ -494,7 +495,7 @@ yyerror(const char *s) s, yyInput); warnx("%s", str); - xfree(str); + free(str); return (0); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/diff.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/diff.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/diff.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.37 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: diff.c,v 1.38 2015/06/13 20:15:21 nicm Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -72,6 +72,7 @@ #include <stdint.h> #include <stddef.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <unistd.h> #include <limits.h> @@ -374,13 +375,13 @@ diffreg(const char *file1, const char *f clistlen = 100; clist = xcalloc(clistlen, sizeof(*clist)); i = stone(class, slen[0], member, klist, flags); - xfree(member); - xfree(class); + free(member); + free(class); J = xreallocarray(J, len[0] + 2, sizeof(*J)); unravel(klist[i]); - xfree(clist); - xfree(klist); + free(clist); + free(klist); ixold = xreallocarray(ixold, len[0] + 2, sizeof(*ixold)); ixnew = xreallocarray(ixnew, len[1] + 2, sizeof(*ixnew)); @@ -769,7 +770,7 @@ unsort(struct line *f, int l, int *b) a[f[i].serial] = f[i].value; for (i = 1; i <= l; i++) b[i] = a[i]; - xfree(a); + free(a); } static int @@ -860,7 +861,7 @@ ignoreline(char *line) int ret; ret = regexec(diff_ignore_re, line, 0, NULL, 0); - xfree(line); + free(line); return (ret == 0); /* if it matched, it should be ignored. */ } @@ -1383,5 +1384,5 @@ diff_output(const char *fmt, ...) buf_append(diffbuf, str, strlen(str)); else printf("%s", str); - xfree(str); + free(str); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/diff3.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/diff3.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/diff3.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3.c,v 1.35 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: diff3.c,v 1.39 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -69,6 +69,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <time.h> #include <unistd.h> #include "diff.h" @@ -234,14 +235,10 @@ merge_diff3(char **av, int flags) warnx("warning: overlaps or other problems during merge"); out: - if (b2 != NULL) - buf_free(b2); - if (b3 != NULL) - buf_free(b3); - if (d1 != NULL) - buf_free(d1); - if (d2 != NULL) - buf_free(d2); + buf_free(b2); + buf_free(b3); + buf_free(d1); + buf_free(d2); (void)unlink(path1); (void)unlink(path2); @@ -249,20 +246,13 @@ out: (void)unlink(dp13); (void)unlink(dp23); - if (path1 != NULL) - xfree(path1); - if (path2 != NULL) - xfree(path2); - if (path3 != NULL) - xfree(path3); - if (dp13 != NULL) - xfree(dp13); - if (dp23 != NULL) - xfree(dp23); - if (data != NULL) - xfree(data); - if (patch != NULL) - xfree(patch); + free(path1); + free(path2); + free(path3); + free(dp13); + free(dp23); + free(data); + free(patch); return (diffb); } @@ -361,14 +351,10 @@ rcs_diff3(RCSFILE *rf, char *workfile, R warnx("warning: overlaps or other problems during merge"); out: - if (b2 != NULL) - buf_free(b2); - if (b3 != NULL) - buf_free(b3); - if (d1 != NULL) - buf_free(d1); - if (d2 != NULL) - buf_free(d2); + buf_free(b2); + buf_free(b3); + buf_free(d1); + buf_free(d2); (void)unlink(path1); (void)unlink(path2); @@ -376,20 +362,13 @@ out: (void)unlink(dp13); (void)unlink(dp23); - if (path1 != NULL) - xfree(path1); - if (path2 != NULL) - xfree(path2); - if (path3 != NULL) - xfree(path3); - if (dp13 != NULL) - xfree(dp13); - if (dp23 != NULL) - xfree(dp23); - if (data != NULL) - xfree(data); - if (patch != NULL) - xfree(patch); + free(path1); + free(path2); + free(path3); + free(dp13); + free(dp23); + free(data); + free(patch); return (diffb); } @@ -657,7 +636,7 @@ merge(size_t m1, size_t m2) d1 = d13; d2 = d23; j = 0; - while ((t1 = d1 < d13 + m1) | (t2 = d2 < d23 + m2)) { + while ((t1 = (d1 < d13 + m1)) | (t2 = (d2 < d23 + m2))) { if (debug) { printf("%d,%d=%d,%d %d,%d=%d,%d\n", d1->old.from, d1->old.to, Modified: vendor/OpenBSD/dist/usr.bin/rcs/ident.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/ident.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/ident.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: ident.c,v 1.30 2014/10/02 06:23:15 otto Exp $ */ +/* $OpenBSD: ident.c,v 1.32 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org> * All rights reserved. @@ -28,6 +28,7 @@ #include <err.h> #include <stdio.h> #include <stdlib.h> +#include <time.h> #include <unistd.h> #include "rcsprog.h" @@ -156,8 +157,7 @@ ident_line(FILE *fp) found++; out: - if (bp != NULL) - buf_free(bp); + buf_free(bp); } __dead void Modified: vendor/OpenBSD/dist/usr.bin/rcs/merge.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/merge.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/merge.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: merge.c,v 1.9 2014/10/10 08:15:25 otto Exp $ */ +/* $OpenBSD: merge.c,v 1.10 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> * All rights reserved. @@ -27,6 +27,7 @@ #include <err.h> #include <stdio.h> #include <stdlib.h> +#include <time.h> #include <unistd.h> #include "rcsprog.h" Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcs.1 ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcs.1 Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcs.1 Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -.\" $OpenBSD: rcs.1,v 1.58 2013/01/18 11:21:09 guenther Exp $ +.\" $OpenBSD: rcs.1,v 1.59 2015/09/25 15:31:24 schwarze Exp $ .\" .\" Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org> .\" Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org> @@ -24,7 +24,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 18 2013 $ +.Dd $Mdocdate: September 25 2015 $ .Dt RCS 1 .Os .Sh NAME @@ -40,8 +40,7 @@ .Op Fl e Ns Op Ar users .Op Fl k Ns Ar mode .Op Fl l Ns Op Ar rev -.Oo Fl m Ns Ar rev : -.Ar msg Oc +.Op Fl m Ns Ar rev : Ns Ar msg .Op Fl o Ns Ar rev .Op Fl t Ns Op Ar str .Op Fl u Ns Op Ar rev Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcs.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcs.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcs.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.82 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: rcs.c,v 1.85 2016/05/09 13:03:55 schwarze Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -66,6 +66,7 @@ struct rcs_kw rcs_expkw[] = { { "Revision", RCS_KW_REVISION }, { "Source", RCS_KW_SOURCE }, { "State", RCS_KW_STATE }, + { "Mdocdate", RCS_KW_MDOCDATE }, }; int rcs_errno = RCS_ERR_NOERR; @@ -157,44 +158,40 @@ rcs_close(RCSFILE *rfp) while (!TAILQ_EMPTY(&(rfp->rf_access))) { rap = TAILQ_FIRST(&(rfp->rf_access)); TAILQ_REMOVE(&(rfp->rf_access), rap, ra_list); - xfree(rap->ra_name); - xfree(rap); + free(rap->ra_name); + free(rap); } while (!TAILQ_EMPTY(&(rfp->rf_symbols))) { rsp = TAILQ_FIRST(&(rfp->rf_symbols)); TAILQ_REMOVE(&(rfp->rf_symbols), rsp, rs_list); rcsnum_free(rsp->rs_num); - xfree(rsp->rs_name); - xfree(rsp); + free(rsp->rs_name); + free(rsp); } while (!TAILQ_EMPTY(&(rfp->rf_locks))) { rlp = TAILQ_FIRST(&(rfp->rf_locks)); TAILQ_REMOVE(&(rfp->rf_locks), rlp, rl_list); rcsnum_free(rlp->rl_num); - xfree(rlp->rl_name); - xfree(rlp); + free(rlp->rl_name); + free(rlp); } - if (rfp->rf_head != NULL) - rcsnum_free(rfp->rf_head); - if (rfp->rf_branch != NULL) - rcsnum_free(rfp->rf_branch); + rcsnum_free(rfp->rf_head); + rcsnum_free(rfp->rf_branch); if (rfp->rf_file != NULL) fclose(rfp->rf_file); - if (rfp->rf_path != NULL) - xfree(rfp->rf_path); - if (rfp->rf_comment != NULL) - xfree(rfp->rf_comment); - if (rfp->rf_expand != NULL) - xfree(rfp->rf_expand); - if (rfp->rf_desc != NULL) - xfree(rfp->rf_desc); + + free(rfp->rf_path); + free(rfp->rf_comment); + free(rfp->rf_expand); + free(rfp->rf_desc); if (rfp->rf_pdata != NULL) rcsparse_free(rfp); - xfree(rfp); + + free(rfp); } /* @@ -349,8 +346,7 @@ rcs_write(RCSFILE *rfp) rfp->rf_flags |= RCS_SYNCED; - if (fn != NULL) - xfree(fn); + free(fn); } /* @@ -420,7 +416,7 @@ rcs_movefile(char *from, char *to, mode_ out: (void)fclose(src); (void)fclose(dst); - xfree(buf); + free(buf); return (0); } @@ -509,8 +505,8 @@ rcs_access_remove(RCSFILE *file, const c } TAILQ_REMOVE(&(file->rf_access), ap, ra_list); - xfree(ap->ra_name); - xfree(ap); + free(ap->ra_name); + free(ap); /* not synced anymore */ file->rf_flags &= ~RCS_SYNCED; @@ -582,9 +578,9 @@ rcs_sym_remove(RCSFILE *file, const char } TAILQ_REMOVE(&(file->rf_symbols), symp, rs_list); - xfree(symp->rs_name); + free(symp->rs_name); rcsnum_free(symp->rs_num); - xfree(symp); + free(symp); /* not synced anymore */ file->rf_flags &= ~RCS_SYNCED; @@ -743,8 +739,8 @@ rcs_lock_remove(RCSFILE *file, const cha TAILQ_REMOVE(&(file->rf_locks), lkp, rl_list); rcsnum_free(lkp->rl_num); - xfree(lkp->rl_name); - xfree(lkp); + free(lkp->rl_name); + free(lkp); /* not synced anymore */ file->rf_flags &= ~RCS_SYNCED; @@ -762,8 +758,7 @@ rcs_desc_set(RCSFILE *file, const char * char *tmp; tmp = xstrdup(desc); - if (file->rf_desc != NULL) - xfree(file->rf_desc); + free(file->rf_desc); file->rf_desc = tmp; file->rf_flags &= ~RCS_SYNCED; } @@ -779,8 +774,7 @@ rcs_comment_set(RCSFILE *file, const cha char *tmp; tmp = xstrdup(comment); - if (file->rf_comment != NULL) - xfree(file->rf_comment); + free(file->rf_comment); file->rf_comment = tmp; file->rf_flags &= ~RCS_SYNCED; } @@ -839,7 +833,7 @@ rcs_patch_lines(struct rcs_lines *dlines for (i = 0; (i < nbln) && (dlp != NULL); i++) { ndlp = TAILQ_NEXT(dlp, l_list); TAILQ_REMOVE(&(dlines->l_lines), dlp, l_list); - xfree(dlp); + free(dlp); dlp = ndlp; /* last line is gone - reset dlp */ if (dlp == NULL) { @@ -1020,7 +1014,7 @@ rcs_getrev(RCSFILE *rfp, RCSNUM *frev) return (NULL); rbuf = rcs_patchfile(data, dlen, patch, plen, rcs_patch_lines); - xfree(data); + free(data); if (rbuf == NULL) break; @@ -1246,10 +1240,8 @@ rcs_rev_remove(RCSFILE *rf, RCSNUM *rev) rcs_freedelta(rdp); - if (path_tmp1 != NULL) - xfree(path_tmp1); - if (path_tmp2 != NULL) - xfree(path_tmp2); + free(path_tmp1); + free(path_tmp2); return (0); } @@ -1343,8 +1335,7 @@ rcs_kwexp_set(RCSFILE *file, int mode) } tmp = xstrdup(buf); - if (file->rf_expand != NULL) - xfree(file->rf_expand); + free(file->rf_expand); file->rf_expand = tmp; /* not synced anymore */ file->rf_flags &= ~RCS_SYNCED; @@ -1414,29 +1405,22 @@ rcs_freedelta(struct rcs_delta *rdp) { struct rcs_branch *rb; - if (rdp->rd_num != NULL) - rcsnum_free(rdp->rd_num); - if (rdp->rd_next != NULL) - rcsnum_free(rdp->rd_next); - - if (rdp->rd_author != NULL) - xfree(rdp->rd_author); - if (rdp->rd_locker != NULL) - xfree(rdp->rd_locker); - if (rdp->rd_state != NULL) - xfree(rdp->rd_state); - if (rdp->rd_log != NULL) - xfree(rdp->rd_log); - if (rdp->rd_text != NULL) - xfree(rdp->rd_text); + rcsnum_free(rdp->rd_num); + rcsnum_free(rdp->rd_next); + + free(rdp->rd_author); + free(rdp->rd_locker); + free(rdp->rd_state); + free(rdp->rd_log); + free(rdp->rd_text); while ((rb = TAILQ_FIRST(&(rdp->rd_branches))) != NULL) { TAILQ_REMOVE(&(rdp->rd_branches), rb, rb_list); rcsnum_free(rb->rb_num); - xfree(rb); + free(rb); } - xfree(rdp); + free(rdp); } /* @@ -1613,6 +1597,16 @@ rcs_expand_keywords(char *rcsfile_in, st buf_putc(newbuf, ' '); } + if (kwtype & RCS_KW_MDOCDATE) { + strftime(buf, sizeof(buf), "%B", &tb); + buf_puts(newbuf, buf); + /* Only one blank before single-digit day. */ + snprintf(buf, sizeof(buf), " %d", tb.tm_mday); + buf_puts(newbuf, buf); + strftime(buf, sizeof(buf), " %Y ", &tb); + buf_puts(newbuf, buf); + } + if (kwtype & RCS_KW_NAME) buf_putc(newbuf, ' '); @@ -1701,8 +1695,7 @@ rcs_deltatext_set(RCSFILE *rfp, RCSNUM * if ((rdp = rcs_findrev(rfp, rev)) == NULL) return (-1); - if (rdp->rd_text != NULL) - xfree(rdp->rd_text); + free(rdp->rd_text); len = buf_len(bp); dtext = buf_release(bp); @@ -1717,8 +1710,7 @@ rcs_deltatext_set(RCSFILE *rfp, RCSNUM * rdp->rd_tlen = 0; } - if (dtext != NULL) - xfree(dtext); + free(dtext); return (0); } @@ -1736,8 +1728,7 @@ rcs_rev_setlog(RCSFILE *rfp, RCSNUM *rev if ((rdp = rcs_findrev(rfp, rev)) == NULL) return (-1); - if (rdp->rd_log != NULL) - xfree(rdp->rd_log); + free(rdp->rd_log); rdp->rd_log = xstrdup(logtext); rfp->rf_flags &= ~RCS_SYNCED; @@ -1776,8 +1767,7 @@ rcs_state_set(RCSFILE *rfp, RCSNUM *rev, if ((rdp = rcs_findrev(rfp, rev)) == NULL) return (-1); - if (rdp->rd_state != NULL) - xfree(rdp->rd_state); + free(rdp->rd_state); rdp->rd_state = xstrdup(state); Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcs.h ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcs.h Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcs.h Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.h,v 1.16 2013/06/03 17:04:35 jcs Exp $ */ +/* $OpenBSD: rcs.h,v 1.17 2016/05/09 13:03:55 schwarze Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -69,6 +69,7 @@ #define RCS_KW_SOURCE 0x0400 #define RCS_KW_STATE 0x0800 #define RCS_KW_FULLPATH 0x0010 +#define RCS_KW_MDOCDATE 0x0020 #define RCS_KW_LOCKER 0x10000 #define RCS_KW_ID \ Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsclean.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsclean.c,v 1.54 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: rcsclean.c,v 1.56 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -30,6 +30,7 @@ #include <err.h> #include <stdio.h> #include <stdlib.h> +#include <time.h> #include <unistd.h> #include "rcsprog.h" @@ -209,10 +210,8 @@ rcsclean_file(char *fname, const char *r rcs_set_mtime(file, rcs_mtime); out: - if (b1 != NULL) - buf_free(b1); - if (b2 != NULL) - buf_free(b2); + buf_free(b1); + buf_free(b2); if (file != NULL) rcs_close(file); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsdiff.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsdiff.c,v 1.82 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: rcsdiff.c,v 1.84 2015/11/02 16:45:21 nicm Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -250,15 +250,9 @@ rcsdiff_main(int argc, char **argv) status = rcsdiff_rev(file, rev1, rev2, dflags); rcs_close(file); - - if (rev1 != NULL) { - rcsnum_free(rev1); - rev1 = NULL; - } - if (rev2 != NULL) { - rcsnum_free(rev2); - rev2 = NULL; - } + rcsnum_free(rev1); + rcsnum_free(rev2); + rev1 = rev2 = NULL; } return (status); @@ -354,14 +348,10 @@ rcsdiff_file(RCSFILE *file, RCSNUM *rev, out: if (fd != -1) (void)close(fd); - if (b1 != NULL) - buf_free(b1); - if (b2 != NULL) - buf_free(b2); - if (path1 != NULL) - xfree(path1); - if (path2 != NULL) - xfree(path2); + buf_free(b1); + buf_free(b2); + free(path1); + free(path2); return (ret); } @@ -433,14 +423,10 @@ rcsdiff_rev(RCSFILE *file, RCSNUM *rev1, ret = diffreg(path1, path2, NULL, dflags); out: - if (b1 != NULL) - buf_free(b1); - if (b2 != NULL) - buf_free(b2); - if (path1 != NULL) - xfree(path1); - if (path2 != NULL) - xfree(path2); + buf_free(b1); + buf_free(b2); + free(path1); + free(path2); return (ret); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsmerge.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsmerge.c,v 1.55 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: rcsmerge.c,v 1.57 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org> * All rights reserved. @@ -28,6 +28,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <time.h> #include <unistd.h> #include "rcsprog.h" @@ -173,12 +174,8 @@ rcsmerge_main(int argc, char **argv) out: rcs_close(file); - - if (rev1 != NULL) - rcsnum_free(rev1); - if (rev2 != NULL) - rcsnum_free(rev2); - + rcsnum_free(rev1); + rcsnum_free(rev2); return (status); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsnum.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsnum.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsnum.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsnum.c,v 1.16 2015/01/16 06:40:11 deraadt Exp $ */ +/* $OpenBSD: rcsnum.c,v 1.19 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -26,8 +26,10 @@ #include <ctype.h> #include <err.h> -#include <string.h> #include <limits.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> #include "rcs.h" #include "xmalloc.h" @@ -104,9 +106,10 @@ rcsnum_parse(const char *str) void rcsnum_free(RCSNUM *rn) { - if (rn->rn_id != NULL) - xfree(rn->rn_id); - xfree(rn); + if (rn == NULL) + return; + free(rn->rn_id); + free(rn); } /* @@ -331,7 +334,7 @@ rcsnum_aton(const char *str, char **ep, rcsnum_aton_failed: nump->rn_len = 0; - xfree(nump->rn_id); + free(nump->rn_id); nump->rn_id = NULL; return (-1); } Modified: vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.c ============================================================================== --- vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.c Sun Sep 11 14:19:06 2016 (r305693) +++ vendor/OpenBSD/dist/usr.bin/rcs/rcsparse.c Sun Sep 11 15:55:11 2016 (r305694) @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsparse.c,v 1.14 2014/12/01 21:58:46 deraadt Exp $ */ +/* $OpenBSD: rcsparse.c,v 1.16 2016/08/26 09:02:54 guenther Exp $ */ /* * Copyright (c) 2010 Tobias Stoeckmann <tobias@openbsd.org> * @@ -24,6 +24,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <time.h> #include <unistd.h> #include "rcs.h" @@ -340,11 +341,10 @@ rcsparse_free(RCSFILE *rfp) pdp = rfp->rf_pdata; - if (pdp->rp_buf != NULL) - xfree(pdp->rp_buf); + free(pdp->rp_buf); if (pdp->rp_token == RCS_TYPE_REVISION) rcsnum_free(pdp->rp_value.rev); - xfree(pdp); + free(pdp); } /* @@ -609,7 +609,7 @@ rcsparse_text(RCSFILE *rfp, struct rcs_p memcpy(pdp->rp_delta->rd_text, pdp->rp_buf, pdp->rp_delta->rd_tlen); } - xfree(pdp->rp_value.str); + free(pdp->rp_value.str); return (0); } @@ -707,7 +707,7 @@ rcsparse_symbols(RCSFILE *rfp, struct rc name = pdp->rp_value.str; if (rcsparse_token(rfp, RCS_TOK_COLON) != RCS_TOK_COLON || rcsparse_token(rfp, RCS_TYPE_NUMBER) != RCS_TYPE_NUMBER) { - xfree(name); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609111555.u8BFtCRY051694>