Make get_linestr return NULL/undef if we aren't parsing.
rafl [Sun, 12 Oct 2008 14:26:44 +0000 (14:26 +0000)]
git-svn-id: http://dev.catalyst.perl.org/repos/bast/Devel-Declare/1.000/trunk@4916 bd8105ee-0ff8-0310-8827-fb3f25b6796d

Declare.xs

index 3b8c5dd..69dd632 100644 (file)
@@ -103,6 +103,9 @@ void dd_linestr_callback (pTHX_ char* type, char* name) {
 }
 
 char* dd_get_linestr(pTHX) {
+  if (!DD_HAVE_PARSER) {
+    return NULL;
+  }
   return SvPVX(PL_linestr);
 }