On OS X to use perl's malloc need to USE_PERL_SBRK and emulate sbrk()
[p5sagit/p5-mst-13.2.git] / toke.c
diff --git a/toke.c b/toke.c
index ad50ec5..76bfc9a 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -8953,7 +8953,7 @@ S_new_constant(pTHX_ const char *s, STRLEN len, const char *key, SV *sv, SV *pv,
     SV *res;
     SV **cvp;
     SV *cv, *typesv;
-    const char *why1, *why2, *why3;
+    const char *why1 = "", *why2 = "", *why3 = "";
 
     if (!table || !(PL_hints & HINT_LOCALIZE_HH)) {
        SV *msg;
@@ -9261,8 +9261,12 @@ S_scan_pat(pTHX_ char *start, I32 type)
     PMOP *pm;
     char *s = scan_str(start,FALSE,FALSE);
 
-    if (!s)
-       Perl_croak(aTHX_ "Search pattern not terminated");
+    if (!s) {
+       char *delimiter = skipspace(start);
+       Perl_croak(aTHX_ *delimiter == '?'
+                  ? "Search pattern not terminated or ternary operator parsed as search pattern"
+                  : "Search pattern not terminated" );
+    }
 
     pm = (PMOP*)newPMOP(type, 0);
     if (PL_multi_open == '?')