diff --git a/Source/kwsys/RegularExpression.cxx b/Source/kwsys/RegularExpression.cxx index 3566a651b..6a623513e 100644 --- a/Source/kwsys/RegularExpression.cxx +++ b/Source/kwsys/RegularExpression.cxx @@ -77,6 +77,10 @@ RegularExpression::RegularExpression (const RegularExpression& rxp) { // operator= -- Copies the given regular expression. RegularExpression& RegularExpression::operator= (const RegularExpression& rxp) { + if(this == &rxp) + { + return *this; + } if ( !rxp.program ) { this->program = 0;