Mention /usr/share/locale.
[p5sagit/p5-mst-13.2.git] / regcomp.c
index 70682ae..f78388b 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -146,6 +146,7 @@ static void regtail _((regnode *, regnode *));
 static char* regwhite _((char *, char *));
 static char* nextchar _((void));
 static void re_croak2 _((const char* pat1,const char* pat2,...)) __attribute__((noreturn));
+static char* regpposixcc _((I32 value));
 #endif
 
 /* Length of a variant. */
@@ -776,7 +777,7 @@ reginitcolors(void)
                PL_colors[i] = ++s;
            }
            else
-               PL_colors[i] = "";
+               PL_colors[i] = s = "";
        }
     } else {
        while (i < 6) 
@@ -1878,6 +1879,8 @@ tryagain:
                FAIL("trailing \\ in regexp");
            /* FALL THROUGH */
        default:
+           /* Do not generate `unrecognized' warnings here, we fall
+              back into the quick-grab loop below */
            goto defchar;
        }
        break;
@@ -2008,6 +2011,11 @@ tryagain:
                            FAIL("trailing \\ in regexp");
                        /* FALL THROUGH */
                    default:
+                       if (!SIZE_ONLY && ckWARN(WARN_UNSAFE) && isALPHA(*p))
+                           warner(WARN_UNSAFE, 
+                                  "/%.127s/: Unrecognized escape \\%c passed through",
+                                  PL_regprecomp,
+                                  *p);
                        goto normal_default;
                    }
                    break;
@@ -2097,6 +2105,7 @@ regwhite(char *p, char *e)
 STATIC char*
 regpposixcc(I32 value)
 {
+    dTHR;
     char *posixcc = 0;
 
     if (value == '[' && PL_regcomp_parse + 1 < PL_regxend &&
@@ -3211,4 +3220,15 @@ save_re_context(void)
     SAVESPTR(PL_regcode);              /* Code-emit pointer; &regdummy = don't */
     SAVEPPTR(PL_regxend);              /* End of input for compile */
     SAVEPPTR(PL_regcomp_parse);                /* Input-scan pointer. */
+    SAVESPTR(PL_reg_call_cc);          /* from regexec.c */
+    SAVESPTR(PL_reg_re);               /* from regexec.c */
+    SAVEPPTR(PL_reg_ganch);            /* from regexec.c */
+    SAVESPTR(PL_reg_sv);               /* from regexec.c */
+    SAVESPTR(PL_reg_magic);            /* from regexec.c */
+    SAVEI32(PL_reg_oldpos);                    /* from regexec.c */
+    SAVESPTR(PL_reg_oldcurpm);         /* from regexec.c */
+    SAVESPTR(PL_reg_curpm);            /* from regexec.c */
+#ifdef DEBUGGING
+    SAVEPPTR(PL_reg_starttry);         /* from regexec.c */    
+#endif
 }