From owner-svn-src-stable-10@freebsd.org Sat Dec 26 18:26:46 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CE55A53C30; Sat, 26 Dec 2015 18:26:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5A8D715FB; Sat, 26 Dec 2015 18:26:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBQIQjno022596; Sat, 26 Dec 2015 18:26:45 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQIQjhS022592; Sat, 26 Dec 2015 18:26:45 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201512261826.tBQIQjhS022592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 26 Dec 2015 18:26:45 +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: r292753 - stable/10/usr.bin/bc 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-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 18:26:46 -0000 Author: pfg Date: Sat Dec 26 18:26:44 2015 New Revision: 292753 URL: https://svnweb.freebsd.org/changeset/base/292753 Log: MFC r291155: bc: sync with OpenBSD tty.c Rev. 1.3 Avoid unintended problems with operator precedence when doing an assignment and comparison. bc.1, Rev. 1.31, 1.32 '.Ql Quit' -> '.Ql quit' because only the lowercase command is valid. Clarify sentence about `quit` in BUGS section. extern.h, Rev. 1.12 whitespace bc.y, Rev. 1.47 Prefer setvbuf() to setlinebuf() for portability Obtained from: OpenBSD Modified: stable/10/usr.bin/bc/bc.1 stable/10/usr.bin/bc/bc.y stable/10/usr.bin/bc/extern.h stable/10/usr.bin/bc/tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bc/bc.1 ============================================================================== --- stable/10/usr.bin/bc/bc.1 Sat Dec 26 18:21:32 2015 (r292752) +++ stable/10/usr.bin/bc/bc.1 Sat Dec 26 18:26:44 2015 (r292753) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.\" $OpenBSD: bc.1,v 1.30 2014/01/14 07:42:42 jmc Exp $ +.\" $OpenBSD: bc.1,v 1.32 2015/11/17 05:45:35 mmcc Exp $ .\" .\" Copyright (C) Caldera International Inc. 2001-2002. .\" All rights reserved. @@ -35,7 +35,7 @@ .\" .\" @(#)bc.1 6.8 (Berkeley) 8/8/91 .\" -.Dd April 16, 2014 +.Dd November 21 2015 .Dt BC 1 .Os .Sh NAME @@ -407,8 +407,9 @@ The current version of the utility was written by .An Otto Moerbeek . .Sh BUGS -.Ql Quit -is interpreted when read, not when executed. +The +.Ql quit +statement is interpreted when read, not when executed. .Pp Some non-portable extensions, as found in the GNU version of the .Nm Modified: stable/10/usr.bin/bc/bc.y ============================================================================== --- stable/10/usr.bin/bc/bc.y Sat Dec 26 18:21:32 2015 (r292752) +++ stable/10/usr.bin/bc/bc.y Sat Dec 26 18:26:44 2015 (r292753) @@ -1125,7 +1125,7 @@ main(int argc, char *argv[]) int ch, i; init(); - setlinebuf(stdout); + setvbuf(stdout, NULL, _IOLBF, 0); sargv = malloc(argc * sizeof(char *)); if (sargv == NULL) Modified: stable/10/usr.bin/bc/extern.h ============================================================================== --- stable/10/usr.bin/bc/extern.h Sat Dec 26 18:21:32 2015 (r292752) +++ stable/10/usr.bin/bc/extern.h Sat Dec 26 18:26:44 2015 (r292753) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $OpenBSD: extern.h,v 1.10 2013/09/19 16:12:01 otto Exp $ */ +/* $OpenBSD: extern.h,v 1.12 2014/04/17 19:07:14 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -39,9 +39,9 @@ extern int fileindex; extern int sargc; extern const char **sargv; extern const char *filename; -extern bool interactive; -extern EditLine *el; -extern History *hist; -extern HistEvent he; +extern bool interactive; +extern EditLine *el; +extern History *hist; +extern HistEvent he; extern char *cmdexpr; extern struct termios ttysaved; Modified: stable/10/usr.bin/bc/tty.c ============================================================================== --- stable/10/usr.bin/bc/tty.c Sat Dec 26 18:21:32 2015 (r292752) +++ stable/10/usr.bin/bc/tty.c Sat Dec 26 18:26:44 2015 (r292753) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $OpenBSD: tty.c,v 1.2 2013/11/12 13:54:51 deraadt Exp $ */ +/* $OpenBSD: tty.c,v 1.3 2015/09/05 09:49:24 jsg Exp $ */ /* * Copyright (c) 2013, Otto Moerbeek @@ -30,7 +30,7 @@ settty(struct termios *t) { int ret; - while ((ret = tcsetattr(0, TCSADRAIN, t) == -1) && errno == EINTR) + while ((ret = tcsetattr(0, TCSADRAIN, t)) == -1 && errno == EINTR) continue; return ret; } @@ -40,7 +40,7 @@ gettty(struct termios *t) { int ret; - while ((ret = tcgetattr(0, t) == -1) && errno == EINTR) + while ((ret = tcgetattr(0, t)) == -1 && errno == EINTR) continue; return ret; }