$OpenBSD: patch-Source_cmIfCommand_cxx,v 1.2 2006/07/31 23:55:51 espie Exp $
--- Source/cmIfCommand.cxx.orig	Mon Jul 31 16:49:57 2006
+++ Source/cmIfCommand.cxx	Tue Aug  1 00:32:19 2006
@@ -159,8 +159,7 @@ bool cmIfCommand::IsTrue(const std::vect
   const char *def;
   const char *def2;
   const char* msg = "Unknown arguments specified";
-  *errorString = new char[strlen(msg) + 1];
-  strcpy(*errorString, msg);
+  *errorString = cmSystemTools::dupstring(msg);
 
   // handle empty invocation
   if (args.size() < 1)
@@ -313,8 +312,7 @@ bool cmIfCommand::IsTrue(const std::vect
           cmOStringStream error;
           error << "Regular expression \"" << rex << "\" cannot compile";
           delete [] *errorString;
-          *errorString = new char[error.str().size() + 1];
-          strcpy(*errorString, error.str().c_str());
+          *errorString = cmSystemTools::dupstring(error.str().c_str());
           return false;
           }
         if (regEntry.find(def))
