perl 3.0 patch #14 patch #13, continued
[p5sagit/p5-mst-13.2.git] / regcomp.c
index c0ec81a..9a7be67 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -7,9 +7,18 @@
  * blame Henry for some of the lack of readability.
  */
 
-/* $Header: regcomp.c,v 3.0 89/10/18 15:22:29 lwall Locked $
+/* $Header: regcomp.c,v 3.0.1.3 90/03/12 16:59:22 lwall Locked $
  *
  * $Log:       regcomp.c,v $
+ * Revision 3.0.1.3  90/03/12  16:59:22  lwall
+ * patch13: pattern matches can now use \0 to mean \000
+ * 
+ * Revision 3.0.1.2  90/02/28  18:08:35  lwall
+ * patch9: /[\200-\377]/ didn't work on machines with signed chars
+ * 
+ * Revision 3.0.1.1  89/11/11  04:51:04  lwall
+ * patch2: /[\000]/ didn't work
+ * 
  * Revision 3.0  89/10/18  15:22:29  lwall
  * 3.0 baseline
  * 
@@ -633,7 +642,7 @@ int *flagp;
                        goto defchar;
                case '0': case '1': case '2': case '3': case '4':
                case '5': case '6': case '7': case '8': case '9':
-                       if (isdigit(regparse[1]))
+                       if (isdigit(regparse[1]) || *regparse == '0')
                                goto defchar;
                        else {
                                ret = regnode(REF + *regparse++ - '0');
@@ -702,10 +711,10 @@ int *flagp;
                                        break;
                                case '0': case '1': case '2': case '3':case '4':
                                case '5': case '6': case '7': case '8':case '9':
-                                   if (isdigit(p[1])) {
-                                       foo = *p++ - '0';
-                                       foo <<= 3;
-                                       foo += *p - '0';
+                                   if (isdigit(p[1]) || *p == '0') {
+                                       foo = *p - '0';
+                                       if (isdigit(p[1]))
+                                           foo = (foo<<3) + *++p - '0';
                                        if (isdigit(p[1]))
                                            foo = (foo<<3) + *++p - '0';
                                        ender = foo;
@@ -767,6 +776,7 @@ register int c;
 {
        if (regcode == &regdummy)
            return;
+       c &= 255;
        if (def)
                bits[c >> 3] &= ~(1 << (c & 7));
        else
@@ -874,7 +884,6 @@ regclass()
        }
        if (*regparse != ']')
                FAIL("unmatched [] in regexp");
-       regset(bits,0,0);               /* always bomb out on null */
        regparse++;
        return ret;
 }