Print this page
9083 replace regex implementation with tre

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/awk_xpg4/awk1.c
          +++ new/usr/src/cmd/awk_xpg4/awk1.c
↓ open down ↓ 1636 lines elided ↑ open up ↑
1637 1637                  op = dst + pos; \
1638 1638                  end = dst + len; \
1639 1639          }
1640 1640  #endif
1641 1641  
1642 1642          *dstp = dst = (wchar_t *)malloc(len * sizeof (wchar_t));
1643 1643          if (dst == NULL)
1644 1644                  return (REG_ESPACE);
1645 1645  
1646 1646          if (rp == NULL || rpl == NULL || src == NULL || dst ==  NULL)
1647      -                return (REG_EFATAL);
     1647 +                return (REG_BADPAT);
1648 1648  
1649 1649          glob = 0;       /* match count */
1650 1650          ip = src;       /* source position */
1651 1651          op = dst;       /* destination position */
1652 1652          end = dst + len;
1653 1653  
1654 1654          flags = 0;
1655 1655          while ((regerr = int_regwexec(rp, ip, NSUB, rm, flags)) == REG_OK) {
1656 1656                  /* Copy text preceding match */
1657 1657                  if (op + (i = rm[0].rm_sp - ip) >= end)
↓ open down ↓ 68 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX