Re: Uppercase RE matching problems in FreeBSD 11
On Nov 8, 2016, at 11:54 AM, Stefan Ehmannwrote: > On 07.11.2016 22:13, Charles Swiger wrote: >> On Nov 6, 2016, at 1:49 PM, Stefan Bethke wrote: >>> Am 06.11.2016 um 22:27 schrieb Baptiste Daroussin >>> : That works for POSIX locale aka C aka ASCII only world >>> >>> So what do I set my LANG and LC variables to? I do want UTF-8, but >>> I do also want my scripts to continue to work. Clearly, >>> en_US.UTF-8 is not what I want. Is it C.UTF-8? Or do I set >>> LANG=en_US.UTF-8 and LC_COLLATE=C? >> >> If you want to use a UTF8 locale, then you must start using character >> classes like '[:upper:]' and '[:lower:]' because those will-- or at >> least "should", modulo bugs-- properly handle the collation issues >> including for languages which do not possess a 1-1 mapping between >> upper and lower case letters. >> >> Someone with a German email address is presumably familiar with ß / >> Eszett...? :-) > > Character classes work fine for [a-z], but I don't know of a simple way > to match a range like [a-k]. True. If you need smaller ranges, I don't see a portable way of doing so in a non-POSIX / "C" locale beyond listing them out. Or: > Personally, I prefer the "Rational Range Interpretation" because it > doesn't break backward compatibility and is still standard compliant. ...yes, +1. Many of the GNU tools like grep and gawk have adopted this, but they are replacing the system regex routines with their own code. However, you can't rely on RRI without testing whether you've got a gawk in the $PATH or whether /usr/bin/awk or whichever is really GNU awk. Regards, -- -Chuck ___ freebsd-stable@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: Uppercase RE matching problems in FreeBSD 11
On 07.11.2016 22:13, Charles Swiger wrote: > On Nov 6, 2016, at 1:49 PM, Stefan Bethkewrote: >> Am 06.11.2016 um 22:27 schrieb Baptiste Daroussin >> : >>> That works for POSIX locale aka C aka ASCII only world >> >> So what do I set my LANG and LC variables to? I do want UTF-8, but >> I do also want my scripts to continue to work. Clearly, >> en_US.UTF-8 is not what I want. Is it C.UTF-8? Or do I set >> LANG=en_US.UTF-8 and LC_COLLATE=C? > > If you want to use a UTF8 locale, then you must start using character > classes like '[:upper:]' and '[:lower:]' because those will-- or at > least "should", modulo bugs-- properly handle the collation issues > including for languages which do not possess a 1-1 mapping between > upper and lower case letters. > > Someone with a German email address is presumably familiar with ß / > Eszett...? :-) Character classes work fine for [a-z], but I don't know of a simple way to match a range like [a-k]. Personally, I prefer the "Rational Range Interpretation" because it doesn't break backward compatibility and is still standard compliant. ___ freebsd-stable@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
problem with mpt driver. anyone seen this or similar? (10.3)
Does this ring any bells? even a theory would be a big improvement. memcpy+0xc mpt_read_cfg_page+0xcc mpt_cation+0x148e xpt_action_default+0x7e cam_periph_runccb+0x7c passdoioctl+0x719 passioctl+0x30 devfs_ioctl_f+0x7c kern_ioctl+0x1a8 sys_ioctl+0x11f amd64_syscall+0x3f9 xfast_syscall+0xf7 we see a memory access fault at line 1821.. 1786 int 1787 mpt_read_cfg_page(struct mpt_softc *mpt, int Action, uint32_t PageAddress, 1788 CONFIG_PAGE_HEADER *hdr, size_t len, int sleep_ok, 1789 int timeout_ms) 1790 { 1791 request_t*req; 1792 cfgparms_tparams; 1793 int error; 1794 1795 req = mpt_get_request(mpt, sleep_ok); 1796 if (req == NULL) { 1797 mpt_prt(mpt, "mpt_read_cfg_page: Get request failed!\n"); 1798 return (-1); 1799 } 1800 1801 params.Action = Action; 1802 params.PageVersion = hdr->PageVersion; 1803 params.PageLength = hdr->PageLength; 1804 params.PageNumber = hdr->PageNumber; 1805 params.PageType = hdr->PageType & MPI_CONFIG_PAGETYPE_MASK; 1806 params.PageAddress = PageAddress; 1807 error = mpt_issue_cfg_req(mpt, req, , 1808 req->req_pbuf + MPT_RQSL(mpt), 1809 len, sleep_ok, timeout_ms); 1810 if (error != 0) { 1811 mpt_prt(mpt, "read_cfg_page(%d) timed out\n", Action); 1812 return (-1); 1813 } 1814 1815 if ((req->IOCStatus & MPI_IOCSTATUS_MASK) != MPI_IOCSTATUS_SUCCESS) { 1816 mpt_prt(mpt, "mpt_read_cfg_page: Config Info Status %x\n", 1817 req->IOCStatus); 1818 mpt_free_request(mpt, req); 1819 return (-1); 1820 } 1821 memcpy(hdr, ((uint8_t *)req->req_vbuf)+MPT_RQSL(mpt), len); <-- 1822 mpt_free_request(mpt, req); 1823 return (0); 1824 } 1825 1826 int 1827 mpt_write_cfg_page(struct mpt_softc *mpt, int Action, uint32_t PageAddress, "mpt/mpt.c" [readonly] 3146 lines --58%-- ___ freebsd-stable@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"