svn commit: r305447 - stable/10/contrib/one-true-awk

2016-09-05 Thread Andrey A. Chernov
Author: ache Date: Tue Sep 6 00:32:33 2016 New Revision: 305447 URL: https://svnweb.freebsd.org/changeset/base/305447 Log: MFC r305365 The bug: $ echo x | awk '/[[:cntrl:]]/' x The NUL character in cntrl class truncates the pattern, and an empty pattern matches anything. The pat

svn commit: r305448 - stable/11/contrib/one-true-awk

2016-09-05 Thread Andrey A. Chernov
Author: ache Date: Tue Sep 6 00:33:54 2016 New Revision: 305448 URL: https://svnweb.freebsd.org/changeset/base/305448 Log: MFC r305365 The bug: $ echo x | awk '/[[:cntrl:]]/' x The NUL character in cntrl class truncates the pattern, and an empty pattern matches anything. The pat

svn commit: r305450 - stable/9/contrib/one-true-awk

2016-09-05 Thread Andrey A. Chernov
Author: ache Date: Tue Sep 6 00:53:20 2016 New Revision: 305450 URL: https://svnweb.freebsd.org/changeset/base/305450 Log: MFC r305365 The bug: $ echo x | awk '/[[:cntrl:]]/' x The NUL character in cntrl class truncates the pattern, and an empty pattern matches anything. The pat

svn commit: r305577 - stable/10/lib/libc/stdio

2016-09-07 Thread Andrey A. Chernov
Author: ache Date: Thu Sep 8 05:13:50 2016 New Revision: 305577 URL: https://svnweb.freebsd.org/changeset/base/305577 Log: MFC r305406,r305409,r305412 1) Fix errors handling. 2) Prevent out of bounds access to ws[-1] (passed buffer) which happens when the first mb sequence is incomp

svn commit: r305582 - stable/11/lib/libc/stdio

2016-09-07 Thread Andrey A. Chernov
Author: ache Date: Thu Sep 8 06:53:18 2016 New Revision: 305582 URL: https://svnweb.freebsd.org/changeset/base/305582 Log: MFC r305406,r305409,r305412 1) Fix errors handling. 2) Prevent out of bounds access to ws[-1] (passed buffer) which happens when the first mb sequence is incomp

svn commit: r305583 - stable/10/lib/libc/stdio

2016-09-08 Thread Andrey A. Chernov
Author: ache Date: Thu Sep 8 07:14:48 2016 New Revision: 305583 URL: https://svnweb.freebsd.org/changeset/base/305583 Log: MFC r305413 Fix error handling. Modified: stable/10/lib/libc/stdio/fgets.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdio/

svn commit: r305584 - stable/11/lib/libc/stdio

2016-09-08 Thread Andrey A. Chernov
Author: ache Date: Thu Sep 8 07:16:15 2016 New Revision: 305584 URL: https://svnweb.freebsd.org/changeset/base/305584 Log: MFC r305413 Fix error handling. Modified: stable/11/lib/libc/stdio/fgets.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/stdio/

svn commit: r305841 - head/bin/cat

2016-09-15 Thread Andrey A. Chernov
Author: ache Date: Thu Sep 15 17:24:39 2016 New Revision: 305841 URL: https://svnweb.freebsd.org/changeset/base/305841 Log: Implement multibyte encoding support for -v with fallback MFC after: 7 days Modified: head/bin/cat/cat.c Modified: head/bin/cat/cat.c

svn commit: r306075 - head/lib/libc/stdtime

2016-09-20 Thread Andrey A. Chernov
Author: ache Date: Wed Sep 21 06:44:32 2016 New Revision: 306075 URL: https://svnweb.freebsd.org/changeset/base/306075 Log: 1) Microoptimize %p case. 2) Implememt %u for GNU compatibility. 3) Don't forget to advance buf for %w/%u. 4) Fail with incomplete week (week 0) request and no such w

svn commit: r306109 - head/lib/libc/stdtime

2016-09-21 Thread Andrey A. Chernov
Author: ache Date: Wed Sep 21 15:47:40 2016 New Revision: 306109 URL: https://svnweb.freebsd.org/changeset/base/306109 Log: 1) For already non-standard %z extension implement GNU compatible formats: +hh and -hh. 2) Check for incorrect values for %z. MFC after: 7 days Modified: h

svn commit: r306200 - stable/10/bin/cat

2016-09-22 Thread Andrey A. Chernov
Author: ache Date: Thu Sep 22 16:46:59 2016 New Revision: 306200 URL: https://svnweb.freebsd.org/changeset/base/306200 Log: MFC r305841 Implement multibyte encoding support for -v with fallback Modified: stable/10/bin/cat/cat.c Directory Properties: stable/10/ (props changed) Modifi

svn commit: r306201 - stable/11/bin/cat

2016-09-22 Thread Andrey A. Chernov
Author: ache Date: Thu Sep 22 16:49:53 2016 New Revision: 306201 URL: https://svnweb.freebsd.org/changeset/base/306201 Log: MFC r305841 Implement multibyte encoding support for -v with fallback Modified: stable/11/bin/cat/cat.c Directory Properties: stable/11/ (props changed) Modifi

svn commit: r306326 - stable/9/lib/libc/stdtime

2016-09-25 Thread Andrey A. Chernov
Author: ache Date: Sun Sep 25 23:05:44 2016 New Revision: 306326 URL: https://svnweb.freebsd.org/changeset/base/306326 Log: MFC r272562,r272678,r272679 1) Fix the case we have less arguments for format string than we expected. 2) Return error on unsupported format specs. (both according

svn commit: r306414 - stable/10/lib/libc/stdtime

2016-09-28 Thread Andrey A. Chernov
Author: ache Date: Wed Sep 28 20:49:33 2016 New Revision: 306414 URL: https://svnweb.freebsd.org/changeset/base/306414 Log: MFC r306075,r306109 1) Microoptimize %p case. 2) Implememt %u for GNU compatibility. 3) Don't forget to advance buf for %w/%u. 4) Fail with incomplete week (week

svn commit: r306415 - stable/11/lib/libc/stdtime

2016-09-28 Thread Andrey A. Chernov
Author: ache Date: Wed Sep 28 20:52:58 2016 New Revision: 306415 URL: https://svnweb.freebsd.org/changeset/base/306415 Log: MFC r306075,r306109 1) Microoptimize %p case. 2) Implememt %u for GNU compatibility. 3) Don't forget to advance buf for %w/%u. 4) Fail with incomplete week (week

svn commit: r306416 - stable/9/lib/libc/stdtime

2016-09-28 Thread Andrey A. Chernov
Author: ache Date: Wed Sep 28 20:54:47 2016 New Revision: 306416 URL: https://svnweb.freebsd.org/changeset/base/306416 Log: MFC r306075,r306109 1) Microoptimize %p case. 2) Implememt %u for GNU compatibility. 3) Don't forget to advance buf for %w/%u. 4) Fail with incomplete week (week

svn commit: r285617 - head/tools/build/mk

2015-07-15 Thread Andrey A. Chernov
Author: ache Date: Thu Jul 16 02:08:54 2015 New Revision: 285617 URL: https://svnweb.freebsd.org/changeset/base/285617 Log: Comment out usr/sbin/mailwrapper removal because for no mailwrapper case we have: /usr/sbin/sendmail -> /usr/sbin/mailwrapper /usr/sbin/mailwrapper -> /usr/libexec/se

svn commit: r289931 - head/lib/libc/stdio

2015-10-25 Thread Andrey A. Chernov
Author: ache Date: Sun Oct 25 12:09:28 2015 New Revision: 289931 URL: https://svnweb.freebsd.org/changeset/base/289931 Log: According to POSIX, a write operation shall start at the current size of the stream (if mode had 'a' as the first character). MFC after: 1 week Modified: hea

svn commit: r290110 - in head: include lib/libc/stdio

2015-10-28 Thread Andrey A. Chernov
Author: ache Date: Wed Oct 28 14:40:02 2015 New Revision: 290110 URL: https://svnweb.freebsd.org/changeset/base/290110 Log: Add _flags2 per jhb@ suggestion since no room left in _flags. Rewrite O_APPEND flag checking using new __S2OAP flag. MFC after: 3 weeks Modified: head/includ

svn commit: r290230 - head/lib/libc/stdio

2015-10-31 Thread Andrey A. Chernov
Author: ache Date: Sun Nov 1 06:15:14 2015 New Revision: 290230 URL: https://svnweb.freebsd.org/changeset/base/290230 Log: Don't seek to the end if write buffer is empty (in append modes). PR: 204156 MFC after: 1 week Modified: head/lib/libc/stdio/ftell.c Modified: h

svn commit: r290231 - head/lib/libc/stdio

2015-10-31 Thread Andrey A. Chernov
Author: ache Date: Sun Nov 1 06:47:05 2015 New Revision: 290231 URL: https://svnweb.freebsd.org/changeset/base/290231 Log: Addition to prev. commit. In some edge cases fp->_p can be changed in _sseek(), recalculate. PR: 204156 MFC after: 1 week Modified: head/lib/libc/stdio

svn commit: r290232 - head/lib/libc/stdio

2015-11-01 Thread Andrey A. Chernov
Author: ache Date: Sun Nov 1 08:40:15 2015 New Revision: 290232 URL: https://svnweb.freebsd.org/changeset/base/290232 Log: Microoptimize. Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c =

svn commit: r290329 - head/usr.bin/bsdiff/bsdiff

2015-11-03 Thread Andrey A. Chernov
Author: ache Date: Tue Nov 3 09:50:10 2015 New Revision: 290329 URL: https://svnweb.freebsd.org/changeset/base/290329 Log: Use meaningful errno for ssize_t overflow in read(). Catch size_t overflow in malloc(). PR: 204230 MFC after: 1 week Modified: head/usr.bin/bsdiff/bsdi

svn commit: r290336 - head/usr.bin/bsdiff/bsdiff

2015-11-03 Thread Andrey A. Chernov
Author: ache Date: Tue Nov 3 17:27:24 2015 New Revision: 290336 URL: https://svnweb.freebsd.org/changeset/base/290336 Log: Check for (old|new)size + 1 overflows off_t. PR: 204230 MFC after: 1 week Modified: head/usr.bin/bsdiff/bsdiff/bsdiff.c Modified: head/usr.bin/bsdiff/bs

svn commit: r290544 - in stable/10: include lib/libc/stdio

2015-11-08 Thread Andrey A. Chernov
Author: ache Date: Sun Nov 8 13:37:16 2015 New Revision: 290544 URL: https://svnweb.freebsd.org/changeset/base/290544 Log: MFC: r289863,r289931,r290110,r290230,r290231,r290232 r290232: Microoptimize. r290231: Addition to prev. commit. In some edge cases fp->_p can be chan

svn commit: r290546 - stable/10/usr.bin/bsdiff/bsdiff

2015-11-08 Thread Andrey A. Chernov
Author: ache Date: Sun Nov 8 14:22:57 2015 New Revision: 290546 URL: https://svnweb.freebsd.org/changeset/base/290546 Log: MFC: r290329,r290336 PR: 204230 r290329: Use meaningful errno for ssize_t overflow in read(). Catch size_t overflow in malloc(). r290336: Check for

svn commit: r290549 - head/lib/libc/stdio

2015-11-08 Thread Andrey A. Chernov
Author: ache Date: Sun Nov 8 18:00:44 2015 New Revision: 290549 URL: https://svnweb.freebsd.org/changeset/base/290549 Log: Reorganize code to elimitate one _sseek() call for append modes. MFC after: 1 week Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c

svn commit: r290729 - head/lib/libc/stdio

2015-11-12 Thread Andrey A. Chernov
Author: ache Date: Thu Nov 12 22:24:39 2015 New Revision: 290729 URL: https://svnweb.freebsd.org/changeset/base/290729 Log: 1) Remove my overcomplicated error fallback and just return error immediatelly as old code does, now for append modes too. Real use case for such fallback is impossible

svn commit: r291050 - stable/10/lib/libc/stdio

2015-11-18 Thread Andrey A. Chernov
Author: ache Date: Thu Nov 19 02:04:16 2015 New Revision: 291050 URL: https://svnweb.freebsd.org/changeset/base/291050 Log: MFC: r290549,r290729 r290549: Reorganize code to elimitate one _sseek() call for append modes. r290729: 1) Remove my overcomplicated error fallback and

svn commit: r289863 - head/lib/libc/stdio

2015-10-23 Thread Andrey A. Chernov
Author: ache Date: Sat Oct 24 02:23:15 2015 New Revision: 289863 URL: https://svnweb.freebsd.org/changeset/base/289863 Log: Since no room left in the _flags, reuse __SALC for O_APPEND. It helps to remove _fcntl() call from _ftello() and optimize seek position calculation in _swrite(). M

svn commit: r297532 - head/lib/libc/locale

2016-04-03 Thread Andrey A. Chernov
Author: ache Date: Mon Apr 4 02:43:35 2016 New Revision: 297532 URL: https://svnweb.freebsd.org/changeset/base/297532 Log: EUC-type encodings don't have single byte characters >= 128 This change should not be MFCed until new collate will be MFCed first, because our old EUC tables have so

svn commit: r297557 - head/lib/libc/locale

2016-04-04 Thread Andrey A. Chernov
Author: ache Date: Mon Apr 4 15:56:14 2016 New Revision: 297557 URL: https://svnweb.freebsd.org/changeset/base/297557 Log: SJIS encoding don't have single byte characters >= 224 MFC after: 1 week Modified: head/lib/libc/locale/mskanji.c Modified: head/lib/libc/locale/mskanji.c ===

svn commit: r297798 - stable/10/lib/libc/locale

2016-04-10 Thread Andrey A. Chernov
Author: ache Date: Mon Apr 11 02:21:42 2016 New Revision: 297798 URL: https://svnweb.freebsd.org/changeset/base/297798 Log: MFC r297557: SJIS encoding don't have single byte characters >= 224 Modified: stable/10/lib/libc/locale/mskanji.c Directory Properties: stable/10/ (props changed)

svn commit: r300397 - head/lib/libc/stdlib

2016-05-21 Thread Andrey A. Chernov
Author: ache Date: Sun May 22 06:18:59 2016 New Revision: 300397 URL: https://svnweb.freebsd.org/changeset/base/300397 Log: 1) POSIX prohibits printing errors to stderr here and require returning NULL: "Upon successful completion, initstate() and setstate() shall return a pointer to the

svn commit: r300424 - head/sys/dev/cpuctl

2016-05-22 Thread Andrey A. Chernov
Author: ache Date: Sun May 22 15:22:45 2016 New Revision: 300424 URL: https://svnweb.freebsd.org/changeset/base/300424 Log: Improve panic message by specifying on which cpu it really is. Modified: head/sys/dev/cpuctl/cpuctl.c Modified: head/sys/dev/cpuctl/cpuctl.c ===

svn commit: r300946 - stable/10/lib/libc/stdlib

2016-05-29 Thread Andrey A. Chernov
Author: ache Date: Sun May 29 06:46:17 2016 New Revision: 300946 URL: https://svnweb.freebsd.org/changeset/base/300946 Log: MFC: r300397 1) POSIX prohibits printing errors to stderr here and require returning NULL: "Upon successful completion, initstate() and setstate() shall return

svn commit: r300953 - head/lib/libc/stdlib

2016-05-29 Thread Andrey A. Chernov
Author: ache Date: Sun May 29 11:54:09 2016 New Revision: 300953 URL: https://svnweb.freebsd.org/changeset/base/300953 Log: 1) Unifdef USE_WEAK_SEEDING it is too obsolete to support and makes reading harder. 2) ACM paper require seed to be in [1, 2^31-2] range, so use the same range shi

svn commit: r300956 - head/lib/libc/stdlib

2016-05-29 Thread Andrey A. Chernov
Author: ache Date: Sun May 29 13:57:06 2016 New Revision: 300956 URL: https://svnweb.freebsd.org/changeset/base/300956 Log: 1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes reading hard. 2) Instead of doing range transformation in each and every function here, d

svn commit: r300965 - head/lib/libc/stdlib

2016-05-29 Thread Andrey A. Chernov
Author: ache Date: Sun May 29 16:39:28 2016 New Revision: 300965 URL: https://svnweb.freebsd.org/changeset/base/300965 Log: Micro optimize: C standard guarantees that right shift for unsigned value fills left bits with zero, and we have exact 32bit unsigned value (uint32_t), so there is no r

svn commit: r301069 - head/lib/libc/locale

2016-05-31 Thread Andrey A. Chernov
Author: ache Date: Tue May 31 18:44:33 2016 New Revision: 301069 URL: https://svnweb.freebsd.org/changeset/base/301069 Log: For EILSEQ case in mbsnrtowcs() and wcsnrtombs() update src to point to the character after the one this conversion stopped at. PR: 209907 Submitted by: Roel S

svn commit: r301115 - head/lib/libc/stdlib

2016-06-01 Thread Andrey A. Chernov
Author: ache Date: Wed Jun 1 10:14:25 2016 New Revision: 301115 URL: https://svnweb.freebsd.org/changeset/base/301115 Log: Don't use fixup for C99 and up, the compiler result is already correct. Suggested by: bde MFC after: 1 week Modified: head/lib/libc/stdlib/div.c head/li

svn commit: r301245 - stable/10/lib/libc/locale

2016-06-03 Thread Andrey A. Chernov
Author: ache Date: Fri Jun 3 07:34:59 2016 New Revision: 301245 URL: https://svnweb.freebsd.org/changeset/base/301245 Log: For EILSEQ case in mbsnrtowcs() and wcsnrtombs() update src to point to the character after the one this conversion stopped at. PR: 209907 Submitted by: Roel

<    1   2   3