From owner-svn-src-stable@FreeBSD.ORG Tue Dec 16 21:05:30 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C1D0218; Tue, 16 Dec 2014 21:05:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 579EBEB; Tue, 16 Dec 2014 21:05:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBGL5UOY009087; Tue, 16 Dec 2014 21:05:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBGL5TEE009084; Tue, 16 Dec 2014 21:05:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412162105.sBGL5TEE009084@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 16 Dec 2014 21:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275840 - stable/10/usr.bin/patch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 21:05:30 -0000 Author: pfg Date: Tue Dec 16 21:05:28 2014 New Revision: 275840 URL: https://svnweb.freebsd.org/changeset/base/275840 Log: MFC r275531, r275581, r275582; patch(1): Small changes to sync with OpenBSD Update OpenBSD CVS revision tag for our r255232. Prefer setvbuf() to setlinebuf(). Small space changes, mostly to keep in sync with OpenBSD Obtained from: OpenBSD Modified: stable/10/usr.bin/patch/patch.c stable/10/usr.bin/patch/pch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/patch/patch.c ============================================================================== --- stable/10/usr.bin/patch/patch.c Tue Dec 16 20:45:17 2014 (r275839) +++ stable/10/usr.bin/patch/patch.c Tue Dec 16 21:05:28 2014 (r275840) @@ -23,7 +23,7 @@ * -C option added in 1998, original code by Marc Espie, based on FreeBSD * behaviour * - * $OpenBSD: patch.c,v 1.50 2012/05/15 19:32:02 millert Exp $ + * $OpenBSD: patch.c,v 1.52 2014/11/26 18:34:51 millert Exp $ * $FreeBSD$ * */ @@ -150,8 +150,8 @@ main(int argc, char *argv[]) const char *tmpdir; char *v; - setlinebuf(stdout); - setlinebuf(stderr); + setvbuf(stdout, NULL, _IOLBF, 0); + setvbuf(stderr, NULL, _IOLBF, 0); for (i = 0; i < MAXFILEC; i++) filearg[i] = NULL; Modified: stable/10/usr.bin/patch/pch.c ============================================================================== --- stable/10/usr.bin/patch/pch.c Tue Dec 16 20:45:17 2014 (r275839) +++ stable/10/usr.bin/patch/pch.c Tue Dec 16 21:05:28 2014 (r275840) @@ -24,7 +24,7 @@ * -C option added in 1998, original code by Marc Espie, based on FreeBSD * behaviour * - * $OpenBSD: pch.c,v 1.39 2012/04/11 08:07:13 ajacoutot Exp $ + * $OpenBSD: pch.c,v 1.43 2014/11/18 17:03:35 tobias Exp $ * $FreeBSD$ */ @@ -318,7 +318,8 @@ intuit_diff_type(void) for (t = s + 7; isspace((unsigned char)*t); t++) ; revision = savestr(t); - for (t = revision; *t && !isspace((unsigned char)*t); t++) + for (t = revision; + *t && !isspace((unsigned char)*t); t++) ; *t = '\0'; if (*revision == '\0') { @@ -583,7 +584,8 @@ another_hunk(void) p_end--; return false; } - for (s = buf; *s && !isdigit((unsigned char)*s); s++) + for (s = buf; + *s && !isdigit((unsigned char)*s); s++) ; if (!*s) malformed(); @@ -593,7 +595,8 @@ another_hunk(void) while (isdigit((unsigned char)*s)) s++; if (*s == ',') { - for (; *s && !isdigit((unsigned char)*s); s++) + for (; + *s && !isdigit((unsigned char)*s); s++) ; if (!*s) malformed(); @@ -690,8 +693,8 @@ another_hunk(void) change_line: if (buf[1] == '\n' && canonicalize) strlcpy(buf + 1, " \n", buf_size - 1); - if (!isspace((unsigned char)buf[1]) && buf[1] != '>' && - buf[1] != '<' && + if (!isspace((unsigned char)buf[1]) && + buf[1] != '>' && buf[1] != '<' && repl_beginning && repl_could_be_missing) { repl_missing = true; goto hunk_done; @@ -1420,8 +1423,8 @@ do_ed_script(void) for (t = buf; isdigit((unsigned char)*t) || *t == ','; t++) ; /* POSIX defines allowed commands as {a,c,d,i,s} */ - if (isdigit((unsigned char)*buf) && (*t == 'a' || *t == 'c' || - *t == 'd' || *t == 'i' || *t == 's')) { + if (isdigit((unsigned char)*buf) && + (*t == 'a' || *t == 'c' || *t == 'd' || *t == 'i' || *t == 's')) { if (pipefp != NULL) fputs(buf, pipefp); if (*t != 'd') {