Skip processing a file if the file to be opened is '-'
[p5sagit/p5-mst-13.2.git] / globals.c
index fc88f31..8e19d22 100644 (file)
--- a/globals.c
+++ b/globals.c
@@ -35,10 +35,19 @@ CPerlObj::CPerlObj(IPerlMem* ipM, IPerlEnv* ipE, IPerlStdIO* ipStd,
 void*
 CPerlObj::operator new(size_t nSize, IPerlMem *pvtbl)
 {
-    if(pvtbl != NULL)
+    if(pvtbl)
        return pvtbl->pMalloc(pvtbl, nSize);
-
+#ifndef __MINGW32__
+    /* operator new is supposed to throw std::bad_alloc */
     return NULL;
+#endif
+}
+
+void
+CPerlObj::operator delete(void *pPerl, IPerlMem *pvtbl)
+{
+    if(pvtbl)
+       pvtbl->pFree(pvtbl, pPerl);
 }
 
 void