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:

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

2016-09-21 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

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: r305413 - head/lib/libc/stdio

2016-09-05 Thread Andrey A. Chernov
Author: ache Date: Mon Sep 5 06:46:04 2016 New Revision: 305413 URL: https://svnweb.freebsd.org/changeset/base/305413 Log: Fix error handling. MFC after: 3 days Modified: head/lib/libc/stdio/fgets.c Modified: head/lib/libc/stdio/fgets.c

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

2016-09-05 Thread Andrey A. Chernov
Author: ache Date: Mon Sep 5 06:10:51 2016 New Revision: 305412 URL: https://svnweb.freebsd.org/changeset/base/305412 Log: Fix n == 1 case. Here should be no physical read (fill buffer) attempt (we read n - 1 chars with the room for NUL, see fgets()), and no NULL return. MFC after:

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

2016-09-04 Thread Andrey A. Chernov
Author: ache Date: Mon Sep 5 04:49:58 2016 New Revision: 305409 URL: https://svnweb.freebsd.org/changeset/base/305409 Log: 1) Prevent out of bounds access to ws[-1] (passed buffer) which happens when the first mb sequence is incomplete and there are not enougn chars in the read buffer.

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

2016-09-04 Thread Andrey A. Chernov
Author: ache Date: Mon Sep 5 03:37:28 2016 New Revision: 305406 URL: https://svnweb.freebsd.org/changeset/base/305406 Log: Fix errors handling. MFC after: 3 days Modified: head/lib/libc/stdio/fgetws.c Modified: head/lib/libc/stdio/fgetws.c

svn commit: r305365 - head/contrib/one-true-awk

2016-09-03 Thread Andrey A. Chernov
Author: ache Date: Sat Sep 3 23:04:56 2016 New Revision: 305365 URL: https://svnweb.freebsd.org/changeset/base/305365 Log: The bug: $ echo x | awk '/[[:cntrl:]]/' x The NUL character in cntrl class truncates the pattern, and an empty pattern matches anything. The patch skips NUL as

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

2016-09-01 Thread Andrey A. Chernov
Author: ache Date: Thu Sep 1 20:45:04 2016 New Revision: 305241 URL: https://svnweb.freebsd.org/changeset/base/305241 Log: fgetwc(3) may set both __SEOF and __SERR at once (in case of incomplete sequence near EOF), so we can't just check for (wc == WEOF && !__sfeof(fp)) and must relay on

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

2016-09-01 Thread Andrey A. Chernov
Author: ache Date: Thu Sep 1 18:12:53 2016 New Revision: 305219 URL: https://svnweb.freebsd.org/changeset/base/305219 Log: If error happens, don't overwrite original errno comes from __mbrtowc() and __srefill(). MFC after: 3 days Modified: head/lib/libc/stdio/fgetwc.c Modified:

svn commit: r305144 - head/lib/libc/net

2016-08-31 Thread Andrey A. Chernov
Author: ache Date: Wed Aug 31 18:49:50 2016 New Revision: 305144 URL: https://svnweb.freebsd.org/changeset/base/305144 Log: 'addrlen' does not matter when we need to find the first non-zero bit in the byte from the left and 'addrlen' already counted in 'lim'. PR: 212121 Submitted

svn commit: r305133 - head/lib/libc/net

2016-08-31 Thread Andrey A. Chernov
Author: ache Date: Wed Aug 31 15:47:58 2016 New Revision: 305133 URL: https://svnweb.freebsd.org/changeset/base/305133 Log: Apply the same qsort() usage fix as in r304911 getaddrinfo.c qsort() can't be stabilized with just return(-1) alone. MFC after: 3 days Modified:

svn commit: r304911 - head/lib/libc/net

2016-08-27 Thread Andrey A. Chernov
Author: ache Date: Sat Aug 27 14:43:13 2016 New Revision: 304911 URL: https://svnweb.freebsd.org/changeset/base/304911 Log: The formal behavior of qsort is unstable with regard to objects that are equal. Unfortunately, RFC 3484 requires that otherwise equal objects remain in the order

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

2016-08-25 Thread Andrey A. Chernov
Author: ache Date: Thu Aug 25 21:14:26 2016 New Revision: 304819 URL: https://svnweb.freebsd.org/changeset/base/304819 Log: Original fgetln() from 44lite return sucess for line tail errors, i.e. partial line, but set __SERR and errno in the same time, which is inconsistent. Now both

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

2016-08-25 Thread Andrey A. Chernov
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:

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

2016-08-25 Thread Andrey A. Chernov
Author: ache Date: Thu Aug 25 17:13:04 2016 New Revision: 304810 URL: https://svnweb.freebsd.org/changeset/base/304810 Log: Don't check for __SERR which may stick from one of any previous stdio functions. __SERR is for user and the rest of stdio code do not check it for error sensing

svn commit: r304755 - head/lib/libc/nls

2016-08-24 Thread Andrey A. Chernov
Author: ache Date: Wed Aug 24 16:44:27 2016 New Revision: 304755 URL: https://svnweb.freebsd.org/changeset/base/304755 Log: Use current locale (f.e. set by thread). It was global locale always previously. MFC after: 7 days Modified: head/lib/libc/nls/msgcat.c Modified:

svn commit: r304752 - head/sys/sys

2016-08-24 Thread Andrey A. Chernov
Author: ache Date: Wed Aug 24 15:36:48 2016 New Revision: 304752 URL: https://svnweb.freebsd.org/changeset/base/304752 Log: Bump __FreeBSD_version for LC_*_MASK fix for newlocale(3) and querylocale(3) Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h

svn commit: r304703 - head/include/xlocale

2016-08-23 Thread Andrey A. Chernov
Author: ache Date: Tue Aug 23 20:33:56 2016 New Revision: 304703 URL: https://svnweb.freebsd.org/changeset/base/304703 Log: LC_*_MASK bit shifting order was partially broken from the initial commit time at year 2012. Only LC_COLLATE_MASK and LC_CTYPE_MASK are in the right order. The

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

2016-08-22 Thread Andrey A. Chernov
Author: ache Date: Mon Aug 22 22:28:41 2016 New Revision: 304641 URL: https://svnweb.freebsd.org/changeset/base/304641 Log: 1) Back out r304607 case 2). fgetwln() as its pair fgetln() supposed to return partial line on any errors. See the comment in fgetln.c. Add corresponding comment to

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

2016-08-22 Thread Andrey A. Chernov
Author: ache Date: Mon Aug 22 15:44:54 2016 New Revision: 304607 URL: https://svnweb.freebsd.org/changeset/base/304607 Log: Fix error processing. 1) Don't forget to set __SERR on __slbexpand() error. 2) Check for __fgetwc() errors using errno. Don't check for __SERR as PR suggested, it

svn commit: r304374 - head/usr.bin/calendar/calendars/ru_RU.UTF-8

2016-08-18 Thread Andrey A. Chernov
Author: ache Date: Thu Aug 18 10:18:11 2016 New Revision: 304374 URL: https://svnweb.freebsd.org/changeset/base/304374 Log: Fix TAB replaced with spaces in prev. commit. Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Modified:

svn commit: r303706 - head/lib/libc/gen

2016-08-03 Thread Andrey A. Chernov
Author: ache Date: Wed Aug 3 09:09:34 2016 New Revision: 303706 URL: https://svnweb.freebsd.org/changeset/base/303706 Log: Although the code amount is not big, move POSIX error processing into two sepatate functions to make glob(3) code less obscure and more simple. There is no needs to

svn commit: r303581 - in head/usr.bin/calendar/calendars: ru_RU.KOI8-R ru_RU.UTF-8

2016-07-31 Thread Andrey A. Chernov
Author: ache Date: Sun Jul 31 10:15:04 2016 New Revision: 303581 URL: https://svnweb.freebsd.org/changeset/base/303581 Log: Fix date Modified: head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.military Modified:

svn commit: r303569 - head/usr.bin/calendar/calendars/ru_RU.KOI8-R

2016-07-30 Thread Andrey A. Chernov
Author: ache Date: Sun Jul 31 03:26:53 2016 New Revision: 303569 URL: https://svnweb.freebsd.org/changeset/base/303569 Log: Reflect CLDR timedef changes Modified: head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.common head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.holiday

svn commit: r303568 - head/usr.bin/calendar/calendars/ru_RU.UTF-8

2016-07-30 Thread Andrey A. Chernov
Author: ache Date: Sun Jul 31 03:11:10 2016 New Revision: 303568 URL: https://svnweb.freebsd.org/changeset/base/303568 Log: Remove another vestige of scripted conversion Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Modified:

svn commit: r303566 - head/usr.bin/calendar/calendars/ru_RU.UTF-8

2016-07-30 Thread Andrey A. Chernov
Author: ache Date: Sun Jul 31 02:43:45 2016 New Revision: 303566 URL: https://svnweb.freebsd.org/changeset/base/303566 Log: Remove vestige of scripted conversion Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.common Modified:

svn commit: r303565 - head/lib/libc/gen

2016-07-30 Thread Andrey A. Chernov
Author: ache Date: Sun Jul 31 02:28:50 2016 New Revision: 303565 URL: https://svnweb.freebsd.org/changeset/base/303565 Log: In addition to prev. commit. Since potentially glob2() can return error without setting errno, restore errno before its call. Modified: head/lib/libc/gen/glob.c

svn commit: r303530 - head/lib/libc/gen

2016-07-29 Thread Andrey A. Chernov
Author: ache Date: Sat Jul 30 02:09:11 2016 New Revision: 303530 URL: https://svnweb.freebsd.org/changeset/base/303530 Log: Reset errno for readdirfunc() before contunue. Modified: head/lib/libc/gen/glob.c Modified: head/lib/libc/gen/glob.c

svn commit: r303210 - head/lib/libc/gen

2016-07-22 Thread Andrey A. Chernov
Author: ache Date: Sat Jul 23 03:49:02 2016 New Revision: 303210 URL: https://svnweb.freebsd.org/changeset/base/303210 Log: 1) POSIX defines well when GLOB_NOMATCH or original pattern (instead) should be returned, so we can't return GLOB_NOMATCH blindly just because we dislike something in

svn commit: r303208 - head/lib/libc/gen

2016-07-22 Thread Andrey A. Chernov
Author: ache Date: Sat Jul 23 01:21:58 2016 New Revision: 303208 URL: https://svnweb.freebsd.org/changeset/base/303208 Log: 1) We need the original pattern (in the next round of changes) not only in case it fully constructed, but for half-constructed too, so have no other choice to pass

svn commit: r303142 - head/lib/libc/gen

2016-07-21 Thread Andrey A. Chernov
Author: ache Date: Thu Jul 21 12:53:36 2016 New Revision: 303142 URL: https://svnweb.freebsd.org/changeset/base/303142 Log: 1) GLOB_BRACE was somewhat broken. First it repeatedly calls glob0() in globexp1() recursive calls, but glob0() was not supposed to be called repeatedly in the

svn commit: r303094 - head/usr.bin

2016-07-20 Thread Andrey A. Chernov
Author: ache Date: Wed Jul 20 15:59:37 2016 New Revision: 303094 URL: https://svnweb.freebsd.org/changeset/base/303094 Log: Continuation lines with comments badly affects gprof, it is excluded from build on amd64 f.e. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile

svn commit: r303088 - head/lib/libc/gen

2016-07-20 Thread Andrey A. Chernov
Author: ache Date: Wed Jul 20 12:46:21 2016 New Revision: 303088 URL: https://svnweb.freebsd.org/changeset/base/303088 Log: In addition to r303074 case 1, search for protected L'/' too in globtilde() Modified: head/lib/libc/gen/glob.c Modified: head/lib/libc/gen/glob.c

svn commit: r303074 - head/lib/libc/gen

2016-07-20 Thread Andrey A. Chernov
Author: ache Date: Wed Jul 20 07:30:44 2016 New Revision: 303074 URL: https://svnweb.freebsd.org/changeset/base/303074 Log: 1) Per POSIX (and glibc) GLOB_NOCHECK should return original pattern, unmodified, if no matches found. But our original code strips all '\' returning it. Rewrite the

svn commit: r303014 - head/lib/libc/gen

2016-07-18 Thread Andrey A. Chernov
Author: ache Date: Tue Jul 19 00:25:27 2016 New Revision: 303014 URL: https://svnweb.freebsd.org/changeset/base/303014 Log: 1) Don't protect \/ and \. even if user say so. They are not special chars in any case and needed for further processing. For ~ expansion too. 2) Don't terminate

svn commit: r303013 - head/lib/libc/gen

2016-07-18 Thread Andrey A. Chernov
Author: ache Date: Mon Jul 18 20:24:13 2016 New Revision: 303013 URL: https://svnweb.freebsd.org/changeset/base/303013 Log: g_Ctoc() conversion buffers are smaller than needed up to MB_CUR_MAX - 1 since whole conversion needs a room for (len >= MB_CUR_MAX). It is no difference when

svn commit: r303011 - head/lib/libc/gen

2016-07-18 Thread Andrey A. Chernov
Author: ache Date: Mon Jul 18 19:20:49 2016 New Revision: 303011 URL: https://svnweb.freebsd.org/changeset/base/303011 Log: Change patch from r303004 case 3. According to POSIX gl_errfunc should be called first, then GLOB_ERR should be considered. Modified: head/lib/libc/gen/glob.c

svn commit: r303010 - head/lib/libc/gen

2016-07-18 Thread Andrey A. Chernov
Author: ache Date: Mon Jul 18 18:24:31 2016 New Revision: 303010 URL: https://svnweb.freebsd.org/changeset/base/303010 Log: 1) Add all characters from ~ expansion as protected to be not interpreted as pattern meta chars. 2) GLOB_ERR and gl_errfunc are supposed to work only for real

svn commit: r303004 - head/lib/libc/gen

2016-07-18 Thread Andrey A. Chernov
Author: ache Date: Mon Jul 18 16:06:21 2016 New Revision: 303004 URL: https://svnweb.freebsd.org/changeset/base/303004 Log: 1) POSIX defines well when GLOB_ABORTED can be returned (only for directory open/read errors and with GLOB_ERR and gl_errfunc processing), so we can't blindly return

svn commit: r302948 - head/lib/libc/gen

2016-07-17 Thread Andrey A. Chernov
Author: ache Date: Sun Jul 17 13:10:57 2016 New Revision: 302948 URL: https://svnweb.freebsd.org/changeset/base/302948 Log: Reflect pathnames sorting in collation order. Modified: head/lib/libc/gen/glob.3 Modified: head/lib/libc/gen/glob.3

svn commit: r302944 - head/lib/libc/gen

2016-07-17 Thread Andrey A. Chernov
Author: ache Date: Sun Jul 17 11:25:24 2016 New Revision: 302944 URL: https://svnweb.freebsd.org/changeset/base/302944 Log: In g_Ctoc() apply CHAR() macro to *str to strip all flags. It gains nothing right now, but some architectures theoretically may 64-bit wchar_t and the code looks more

svn commit: r302943 - head/lib/libc/gen

2016-07-17 Thread Andrey A. Chernov
Author: ache Date: Sun Jul 17 09:39:59 2016 New Revision: 302943 URL: https://svnweb.freebsd.org/changeset/base/302943 Log: 1) This file full of direct char <-> wchar_t assignment, not converted, cut them down. This hack still remains: * 2. Illegal byte sequences in filenames are handled

svn commit: r302937 - in head/bin/sh: . tests/expansion

2016-07-16 Thread Andrey A. Chernov
Author: ache Date: Sat Jul 16 13:26:18 2016 New Revision: 302937 URL: https://svnweb.freebsd.org/changeset/base/302937 Log: Path generation was not according to collate Approved by:jilles Added: head/bin/sh/tests/expansion/pathname6.0 (contents, props changed) Modified:

svn commit: r302833 - head/gnu/usr.bin/grep

2016-07-14 Thread Andrey A. Chernov
Author: ache Date: Thu Jul 14 09:47:49 2016 New Revision: 302833 URL: https://svnweb.freebsd.org/changeset/base/302833 Log: Back out non-collating [a-z] ranges. Instead of changing the whole course to another POSIX-permitted way for consistency and uniformity I decide to completely ignore

svn commit: r302832 - head/contrib/libgnuregex

2016-07-14 Thread Andrey A. Chernov
Author: ache Date: Thu Jul 14 09:45:07 2016 New Revision: 302832 URL: https://svnweb.freebsd.org/changeset/base/302832 Log: Back out non-collating [a-z] ranges. Instead of changing the whole course to another POSIX-permitted way for consistency and uniformity I decide to completely ignore

svn commit: r302831 - head/contrib/tcsh

2016-07-14 Thread Andrey A. Chernov
Author: ache Date: Thu Jul 14 09:40:42 2016 New Revision: 302831 URL: https://svnweb.freebsd.org/changeset/base/302831 Log: To mimic system glob, we definitely don't need manual upper/lower hack. The author clearly disagree in the comment, so this patch will be not submitted upstream.

svn commit: r302830 - head/contrib/tcsh

2016-07-14 Thread Andrey A. Chernov
Author: ache Date: Thu Jul 14 09:37:16 2016 New Revision: 302830 URL: https://svnweb.freebsd.org/changeset/base/302830 Log: Back out non-collating [a-z] ranges. Instead of changing the whole course to another POSIX-permitted way for consistency and uniformity I decide to completely ignore

svn commit: r302829 - in head/bin/sh: . tests/builtins

2016-07-14 Thread Andrey A. Chernov
Author: ache Date: Thu Jul 14 09:34:42 2016 New Revision: 302829 URL: https://svnweb.freebsd.org/changeset/base/302829 Log: Back out non-collating [a-z] ranges. Instead of changing the whole course to another POSIX-permitted way for consistency and uniformity I decide to completely ignore

svn commit: r302828 - head/contrib/one-true-awk

2016-07-14 Thread Andrey A. Chernov
Author: ache Date: Thu Jul 14 09:31:52 2016 New Revision: 302828 URL: https://svnweb.freebsd.org/changeset/base/302828 Log: Back out non-collating [a-z] ranges. Instead of changing the whole course to another POSIX-permitted way for consistency and uniformity I decide to completely ignore

svn commit: r302827 - head/usr.bin/tr

2016-07-14 Thread Andrey A. Chernov
Author: ache Date: Thu Jul 14 09:26:53 2016 New Revision: 302827 URL: https://svnweb.freebsd.org/changeset/base/302827 Log: Optimize [Cc]flag case: don't repeatedly add the last character of string2 to squeeze cset when string2 reach its EOS state. Modified: head/usr.bin/tr/tr.c Modified:

svn commit: r302826 - head/usr.bin/tr

2016-07-14 Thread Andrey A. Chernov
Author: ache Date: Thu Jul 14 09:24:55 2016 New Revision: 302826 URL: https://svnweb.freebsd.org/changeset/base/302826 Log: Document incomplete support of [=equiv=] and collation for ranges. Modified: head/usr.bin/tr/tr.1 Modified: head/usr.bin/tr/tr.1

svn commit: r302825 - head/usr.bin/tr

2016-07-14 Thread Andrey A. Chernov
Author: ache Date: Thu Jul 14 09:19:53 2016 New Revision: 302825 URL: https://svnweb.freebsd.org/changeset/base/302825 Log: Back out non-collating [a-z] ranges (r302594). Instead of changing the whole course to another POSIX-permitted way for consistency and uniformity I decide to

svn commit: r302824 - in head/lib/libc: gen locale regex stdio

2016-07-14 Thread Andrey A. Chernov
Author: ache Date: Thu Jul 14 09:07:25 2016 New Revision: 302824 URL: https://svnweb.freebsd.org/changeset/base/302824 Log: 1) Eliminate possibility to call __*collate_range_cmp() with inclomplete locale (which cause core dump) by removing whole 'table' argument by which it passed. 2)

svn commit: r302820 - in head/lib/libc: gen locale regex stdio

2016-07-14 Thread Andrey A. Chernov
Author: ache Date: Thu Jul 14 08:18:12 2016 New Revision: 302820 URL: https://svnweb.freebsd.org/changeset/base/302820 Log: Back out non-collating [a-z] ranges. Instead of changing whole course to another POSIX-permitted way for consistency and uniformity I decide to completely ignore

svn commit: r302781 - head/gnu/usr.bin/grep

2016-07-13 Thread Andrey A. Chernov
Author: ache Date: Wed Jul 13 19:02:59 2016 New Revision: 302781 URL: https://svnweb.freebsd.org/changeset/base/302781 Log: After removing collation for [a-z] ranges in r302512, do it here too. Instead of trying to expand whole range at regcomp() stage as we do, GNU regex allocates

svn commit: r302780 - head/contrib/libgnuregex

2016-07-13 Thread Andrey A. Chernov
Author: ache Date: Wed Jul 13 18:51:19 2016 New Revision: 302780 URL: https://svnweb.freebsd.org/changeset/base/302780 Log: After removing collation for [a-z] ranges in r302512, do it here too. Instead of trying to expand whole range at regcomp() stage as we do, GNU regex allocates

svn commit: r302777 - head/contrib/tcsh

2016-07-13 Thread Andrey A. Chernov
Author: ache Date: Wed Jul 13 16:49:48 2016 New Revision: 302777 URL: https://svnweb.freebsd.org/changeset/base/302777 Log: After removing collation for [a-z] ranges in r302512, mimic system glob() here too. I try to keep the change minimal to not touch contribed code much. I'll send

svn commit: r302742 - head/contrib/one-true-awk

2016-07-13 Thread Andrey A. Chernov
Author: ache Date: Wed Jul 13 10:01:31 2016 New Revision: 302742 URL: https://svnweb.freebsd.org/changeset/base/302742 Log: After removing collation for [a-z] ranges in r302512, do it here too. I'll try to keep the change very minimal to not touch contribed code much. I'll send it

svn commit: r302712 - in head/bin/sh: . tests/builtins

2016-07-13 Thread Andrey A. Chernov
Author: ache Date: Wed Jul 13 08:13:09 2016 New Revision: 302712 URL: https://svnweb.freebsd.org/changeset/base/302712 Log: After removing collation for [a-z] ranges in r302512, do it here too. Approved by:jilles Modified: head/bin/sh/expand.c head/bin/sh/tests/builtins/case7.0

svn commit: r302711 - head/usr.bin/tr

2016-07-13 Thread Andrey A. Chernov
Author: ache Date: Wed Jul 13 07:56:01 2016 New Revision: 302711 URL: https://svnweb.freebsd.org/changeset/base/302711 Log: Fully back out r302594 case 2) since overflow may happens. Modified: head/usr.bin/tr/tr.c Modified: head/usr.bin/tr/tr.c

svn commit: r302628 - head/sys/sys

2016-07-12 Thread Andrey A. Chernov
Author: ache Date: Tue Jul 12 07:16:37 2016 New Revision: 302628 URL: https://svnweb.freebsd.org/changeset/base/302628 Log: Bump __FreeBSD_version after removing collation from [a-z]-type ranges. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h

svn commit: r302616 - head/usr.bin/tr

2016-07-11 Thread Andrey A. Chernov
Author: ache Date: Tue Jul 12 04:29:34 2016 New Revision: 302616 URL: https://svnweb.freebsd.org/changeset/base/302616 Log: Undo r302599 and partially r302594 case 2): since WCHAR_MAX can be not a valid wchar value, it is easier to stay inside wint_t. Modified: head/usr.bin/tr/tr.c

svn commit: r302615 - in head/sys: arm/include arm64/include

2016-07-11 Thread Andrey A. Chernov
Author: ache Date: Tue Jul 12 04:20:44 2016 New Revision: 302615 URL: https://svnweb.freebsd.org/changeset/base/302615 Log: Undo r302601, WCHAR_MAX may not be a valid wchar value. Modified: head/sys/arm/include/_types.h head/sys/arm64/include/_types.h Modified:

svn commit: r302601 - in head/sys: arm/include arm64/include

2016-07-11 Thread Andrey A. Chernov
Author: ache Date: Tue Jul 12 00:37:48 2016 New Revision: 302601 URL: https://svnweb.freebsd.org/changeset/base/302601 Log: I don't know why unsigned int is choosed for wchar_t here, but WCHAR_MAX should be <= WINT_MAX. It is bigger, __UINT_MAX > INT32_MAX Modified:

svn commit: r302599 - head/usr.bin/tr

2016-07-11 Thread Andrey A. Chernov
Author: ache Date: Mon Jul 11 23:06:11 2016 New Revision: 302599 URL: https://svnweb.freebsd.org/changeset/base/302599 Log: Cast WCHAR_MAX to wint_t, it can be unsigned on some systems. Modified: head/usr.bin/tr/tr.c Modified: head/usr.bin/tr/tr.c

svn commit: r302594 - head/usr.bin/tr

2016-07-11 Thread Andrey A. Chernov
Author: ache Date: Mon Jul 11 21:23:50 2016 New Revision: 302594 URL: https://svnweb.freebsd.org/changeset/base/302594 Log: 1) Following r302512 (remove collation support for [a-z]-ranges in libc) remove collation support for a-z ranges here too. It was implemented for single byte locales

svn commit: r302512 - in head/lib/libc: gen locale regex stdio

2016-07-09 Thread Andrey A. Chernov
Author: ache Date: Sun Jul 10 03:49:38 2016 New Revision: 302512 URL: https://svnweb.freebsd.org/changeset/base/302512 Log: Remove broken support for collation in [a-z] type ranges. Only first 256 wide chars are considered currently, all other are just dropped from the range. Proper

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

2016-06-05 Thread Andrey A. Chernov
Author: ache Date: Sun Jun 5 15:46:14 2016 New Revision: 301448 URL: https://svnweb.freebsd.org/changeset/base/301448 Log: Reflect error indication according to POSIX and what those functions currently do. Modified: head/lib/libc/stdlib/random.3 Modified: head/lib/libc/stdlib/random.3

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

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

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

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,

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

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: r300397 - head/lib/libc/stdlib

2016-05-22 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

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: 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

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

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:

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:

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:

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

2015-11-01 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:

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

2015-11-01 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:

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: 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:

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:

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().

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 -

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

2014-10-07 Thread Andrey A. Chernov
Author: ache Date: Tue Oct 7 06:02:08 2014 New Revision: 272678 URL: https://svnweb.freebsd.org/changeset/base/272678 Log: Back out timegm error check from r272562. POSIX treats negative time_t as undefined (i.e. may be valid too, depends on system's policy we don't have) and we don't

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

2014-10-05 Thread Andrey A. Chernov
Author: ache Date: Sun Oct 5 07:29:50 2014 New Revision: 272562 URL: https://svnweb.freebsd.org/changeset/base/272562 Log: 1) For %Z format, understand UTC name too. 2) Return NULL if timegm() fails, because it means we can convert what we have in GMT to local time needed. Modified:

svn commit: r269961 - in head: . lib/libopie

2014-08-13 Thread Andrey A. Chernov
Author: ache Date: Thu Aug 14 04:42:09 2014 New Revision: 269961 URL: http://svnweb.freebsd.org/changeset/base/269961 Log: Bump version because challenge buffer size changed MFC after: 1 week Modified: head/ObsoleteFiles.inc head/lib/libopie/Makefile Modified:

svn commit: r269875 - head/lib/libpam/modules/pam_opie

2014-08-12 Thread Andrey A . Chernov
Author: ache Date: Tue Aug 12 13:28:46 2014 New Revision: 269875 URL: http://svnweb.freebsd.org/changeset/base/269875 Log: According to opie code and even direct mention in opie(4) challenge buffer size must be OPIE_CHALLENGE_MAX + 1, not OPIE_CHALLENGE_MAX Reviewed by:des MFC

svn commit: r269806 - in head/contrib/opie: . libopie

2014-08-11 Thread Andrey A . Chernov
Author: ache Date: Mon Aug 11 12:26:48 2014 New Revision: 269806 URL: http://svnweb.freebsd.org/changeset/base/269806 Log: Fix too long (seed length 12 chars) challenge handling. 1) ext length should be included into OPIE_CHALLENGE_MAX (as all places of opie code expects that). 2)

svn commit: r269809 - head/contrib/opie

2014-08-11 Thread Andrey A . Chernov
Author: ache Date: Mon Aug 11 13:36:02 2014 New Revision: 269809 URL: http://svnweb.freebsd.org/changeset/base/269809 Log: When sha1 support was added, they forget to increase OPIE_HASHNAME_MAX MFC after: 1 week Modified: head/contrib/opie/opie.h Modified: head/contrib/opie/opie.h

svn commit: r269810 - head/usr.bin/opiekey

2014-08-11 Thread Andrey A . Chernov
Author: ache Date: Mon Aug 11 14:37:57 2014 New Revision: 269810 URL: http://svnweb.freebsd.org/changeset/base/269810 Log: Link otp-sha1 to match real challenge prompt, not otp-sha MFC after: 1 week Modified: head/usr.bin/opiekey/Makefile Modified: head/usr.bin/opiekey/Makefile

svn commit: r269811 - head/contrib/opie

2014-08-11 Thread Andrey A . Chernov
Author: ache Date: Mon Aug 11 14:46:09 2014 New Revision: 269811 URL: http://svnweb.freebsd.org/changeset/base/269811 Log: Last '/' for program name, not first one MFC after: 1 week Modified: head/contrib/opie/opiekey.c Modified: head/contrib/opie/opiekey.c

svn commit: r269815 - head

2014-08-11 Thread Andrey A . Chernov
Author: ache Date: Mon Aug 11 15:41:55 2014 New Revision: 269815 URL: http://svnweb.freebsd.org/changeset/base/269815 Log: Add otp-sha MFC after: 1 week Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc

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

2014-07-26 Thread Andrey A. Chernov
Author: ache Date: Sat Jul 26 08:41:03 2014 New Revision: 269116 URL: http://svnweb.freebsd.org/changeset/base/269116 Log: In the Too many open files edge cases don't try to preserve old number for non-std* descriptors, but close old file and retry. Obtained from: inspired by Apple's

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

2014-07-22 Thread Andrey A. Chernov
Author: ache Date: Tue Jul 22 20:13:46 2014 New Revision: 268992 URL: http://svnweb.freebsd.org/changeset/base/268992 Log: Back the whole change out until I figure out how to obtain O_APPEND, it can't be used in this field at all. Modified: head/lib/libc/stdio/ftell.c Modified:

  1   2   >