comparison src/regex.c @ 2453:944c0ecde8b1

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Fri, 02 Apr 1993 22:53:56 +0000
parents 4bf349812f55
children d77bb274b15c
comparison
equal deleted inserted replaced
2452:5c9d9b33f249 2453:944c0ecde8b1
1300 because laststart was nonzero. And we've already 1300 because laststart was nonzero. And we've already
1301 incremented `p', by the way, to be the character after 1301 incremented `p', by the way, to be the character after
1302 the `*'. Do we have to do something analogous here 1302 the `*'. Do we have to do something analogous here
1303 for null bytes, because of RE_DOT_NOT_NULL? */ 1303 for null bytes, because of RE_DOT_NOT_NULL? */
1304 if (TRANSLATE (*(p - 2)) == TRANSLATE ('.') 1304 if (TRANSLATE (*(p - 2)) == TRANSLATE ('.')
1305 && zero_times_ok
1305 && p < pend && TRANSLATE (*p) == TRANSLATE ('\n') 1306 && p < pend && TRANSLATE (*p) == TRANSLATE ('\n')
1306 && !(syntax & RE_DOT_NEWLINE)) 1307 && !(syntax & RE_DOT_NEWLINE))
1307 { /* We have .*\n. */ 1308 { /* We have .*\n. */
1308 STORE_JUMP (jump, b, laststart); 1309 STORE_JUMP (jump, b, laststart);
1309 keep_string_p = true; 1310 keep_string_p = true;
1610 compile_stack.avail++; 1611 compile_stack.avail++;
1611 1612
1612 fixup_alt_jump = 0; 1613 fixup_alt_jump = 0;
1613 laststart = 0; 1614 laststart = 0;
1614 begalt = b; 1615 begalt = b;
1616 /* If we've reached MAX_REGNUM groups, then this open
1617 won't actually generate any code, so we'll have to
1618 clear pending_exact explicitly. */
1619 pending_exact = 0;
1615 break; 1620 break;
1616 1621
1617 1622
1618 case ')': 1623 case ')':
1619 if (syntax & RE_NO_BK_PARENS) goto normal_backslash; 1624 if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
1659 = COMPILE_STACK_TOP.fixup_alt_jump 1664 = COMPILE_STACK_TOP.fixup_alt_jump
1660 ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 1665 ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
1661 : 0; 1666 : 0;
1662 laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset; 1667 laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
1663 this_group_regnum = COMPILE_STACK_TOP.regnum; 1668 this_group_regnum = COMPILE_STACK_TOP.regnum;
1669 /* If we've reached MAX_REGNUM groups, then this open
1670 won't actually generate any code, so we'll have to
1671 clear pending_exact explicitly. */
1672 pending_exact = 0;
1664 1673
1665 /* We're at the end of the group, so now we know how many 1674 /* We're at the end of the group, so now we know how many
1666 groups were inside this one. */ 1675 groups were inside this one. */
1667 if (this_group_regnum <= MAX_REGNUM) 1676 if (this_group_regnum <= MAX_REGNUM)
1668 { 1677 {
4879 to this routine. If we are given anything else, or if other regex 4888 to this routine. If we are given anything else, or if other regex
4880 code generates an invalid error code, then the program has a bug. 4889 code generates an invalid error code, then the program has a bug.
4881 Dump core so we can fix it. */ 4890 Dump core so we can fix it. */
4882 abort (); 4891 abort ();
4883 4892
4893 msg = re_error_msg[errcode];
4894
4895 /* POSIX doesn't require that we do anything in this case, but why
4896 not be nice. */
4897 if (! msg)
4898 msg = "Success";
4899
4884 msg_size = strlen (msg) + 1; /* Includes the null. */ 4900 msg_size = strlen (msg) + 1; /* Includes the null. */
4885 4901
4886 if (errbuf_size != 0) 4902 if (errbuf_size != 0)
4887 { 4903 {
4888 if (msg_size > errbuf_size) 4904 if (msg_size > errbuf_size)