From owner-svn-src-all@freebsd.org Thu Aug 25 17:30:02 2016 Return-Path: Delivered-To: svn-src-all@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 39862BC6791; Thu, 25 Aug 2016 17:30:02 +0000 (UTC) (envelope-from ache@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 07507181F; Thu, 25 Aug 2016 17:30:01 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7PHU1ZZ074254; Thu, 25 Aug 2016 17:30:01 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7PHU1uQ074253; Thu, 25 Aug 2016 17:30:01 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608251730.u7PHU1uQ074253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 25 Aug 2016 17:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304811 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 17:30:02 -0000 Author: ache Date: Thu Aug 25 17:30:00 2016 New Revision: 304811 URL: https://svnweb.freebsd.org/changeset/base/304811 Log: Remove "Fast path", it bypass __wcrtomb() and all its error checking. One of affected encoding example: US-ASCII MFC after: 7 days Modified: head/lib/libc/stdio/fputwc.c Modified: head/lib/libc/stdio/fputwc.c ============================================================================== --- head/lib/libc/stdio/fputwc.c Thu Aug 25 17:13:04 2016 (r304810) +++ head/lib/libc/stdio/fputwc.c Thu Aug 25 17:30:00 2016 (r304811) @@ -53,19 +53,9 @@ __fputwc(wchar_t wc, FILE *fp, locale_t size_t i, len; struct xlocale_ctype *l = XLOCALE_CTYPE(locale); - if (MB_CUR_MAX == 1 && wc > 0 && wc <= UCHAR_MAX) { - /* - * Assume single-byte locale with no special encoding. - * A more careful test would be to check - * _CurrentRuneLocale->encoding. - */ - *buf = (unsigned char)wc; - len = 1; - } else { - if ((len = l->__wcrtomb(buf, wc, &fp->_mbstate)) == (size_t)-1) { - fp->_flags |= __SERR; - return (WEOF); - } + if ((len = l->__wcrtomb(buf, wc, &fp->_mbstate)) == (size_t)-1) { + fp->_flags |= __SERR; + return (WEOF); } for (i = 0; i < len; i++)