summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex/engine.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Drop a const-bomb on regexec. It's probably not a good idea to remove amartijn2018-07-111-52/+60
| | | | | | const promise when processing it in the regex engine. Minor tweak and OK schwarze@
* Delete casts to off_t and size_t that are implied by assignmentsguenther2016-09-211-2/+2
| | | | | | | or prototypes. Ditto for some of the char* and void* casts too. verified no change to instructions on ILP32 (i386) and LP64 (amd64) ok natano@ abluhm@ deraadt@ millert@
* Change the way regexec handles REG_STARTEND combined with REG_NOTBOL.martijn2016-05-261-3/+13
| | | | | | | | | | | | | The new code sees this combination as a continuation of string at offset pmatch[0].rm_so, instead of a new string which starts at that offset. This change fixes a search quirk in vi and is needed for upcoming fixes in ed/sed/vi. This new behaviour is also used in gnu regex. Lots of help from schwarze@ Manpage bits by schwarze@ OK schwarze@ and millert@
* KNF with respect to indentation; no code changeschwarze2016-05-251-28/+27
|
* Fix another one-byte buffer underflow (read access only).schwarze2016-05-251-7/+4
| | | | | | | | | | | | This change touches code that only runs when REG_BASIC is given and the regular expression is anchored with [[:<:]] or \< _and_ uses backreferences. Simplify the logic while here, already looking at the previous character if REG_STARTEND and REG_NOTBOL are both in use, in anticipation of martijn@'s upcoming patch which will further improve REG_STARTEND. OK millert@ martijn@ Also tested by Pedro Giffuni (pfg) on FreeBSD.
* Fix a one-byte buffer underflow (read access only).schwarze2016-05-171-4/+4
| | | | | | | | | | This change touches code that only runs when REG_BASIC is given and the regular expression is anchored with ^ _and_ uses backreferences. The segfault could only be triggered when the ^ anchor was inside a leading () subexpression quantified with *. OK martijn@ Patch also proofread by Pedro Giffuni <pfg at FreeBSD dot org>.
* Remove NULL-checks before free() and needless argument casts.mmcc2015-12-281-5/+3
| | | | ok tb@
* use reallocarray(NULL, a, b) instead of malloc(a, b), which gives usderaadt2014-10-091-5/+5
| | | | | proper mult int overflow detection. The existing code already handles malloc failure properly, of course.
* The print() routine here can be passed at least some of the non-charactersguenther2013-11-281-6/+17
| | | | | | | | | | OUT to EOW, making its domain CHAR_MIN...CODEMAX. It makes sense to have pchar() take the same domain and output those non-characters appropriately, so the (unsigned char) cast for isprint() goes in pchar(). Constipate pchar() while we're here, and let print() pass through NUL to it, as it knows how to output it unambiguously. ok otto@ millert@
* silence some warnings by adding prototypes, casts, and headers astedu2013-04-171-1/+2
| | | | appropriate. in regex, stop using the struct hack for a fixed size array
* zap rcsidespie2005-08-051-5/+1
|
* Plug a mem leak. Now you can run hanoi.sed witt a lot of pegs and nototto2005-01-031-2/+4
| | | | | | run out of mem! From FreeBSD PR 75656. ok millert@ deraadt@
* remove useless comments, once used for header file generation and deleteotto2004-11-301-54/+11
| | | | parameter names from prototypes. ok millert@
* Better fix for the "unbounded recursion case", for exampleotto2004-11-291-17/+18
| | | | | | | | \(b*\)\(a*\1\)*, more cases in regress/lib/libc/regexp/test. Only stop evaluation of a back reference if the match lenght is zero and the recursion level is too deep. With help from jaredy@ Problem case found by Andrew Brown in NetBSD PR 28126. ok deraadt@ millert@
* ansify and deregister; no change in obj code. ok millert@otto2004-10-171-120/+84
|
* Change an assert into a loop termination condition. Fixes a coremillert2004-08-131-3/+4
| | | | dump found by jmc@. OK otto@
* Avoid unbounded recursion in some expressions involving back references.otto2004-04-021-2/+4
| | | | | | | For example: echo "foo foo bar bar bar baz" | sed 's/\([^ ]*\)\( *\1\)*/\1/g' Test case found by dhartmei@ ok millert@ dhartmei@ tedu@
* Allow compilation w/ -DREDEBUG; non-debug compilation is unaffected.millert2004-03-301-2/+6
| | | | From NetBSD.
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-7/+3
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* remaining easy snprintf conversionsderaadt2002-05-251-4/+4
|
* Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.millert2002-02-161-11/+11
|
* - cast usages of *printf() to void since we don't check return valmillert1997-04-281-11/+15
| | | | | | - move an assert to be *before* a strcpy() where it can do some good. - integrate NetBSD fixes for 64-bit machines (NetBSD PR #3450, Ross Harvey) - add lite2 tags
* long -> int to fix 64bit issues. This breaks 16bit machines but since we don't have any 16bit ports...) The alternative is to use int32_t's but then this code will break when/if int > 32bits which is not so unlikely. Fixes NetBSD PR #3450 from Ross Harvey (but in a different way)millert1997-04-121-2/+2
|
* Fix RCS idstholo1996-08-191-4/+4
| | | | Make sure everything uses {SYS,}LIBC_SCCS properly
* initial import of NetBSD treederaadt1995-10-181-0/+1093