diff --git a/RegularExpression.cxx b/RegularExpression.cxx index d502e857a72a176c8b57f7d220e1821f5684596b..2f78adc42a07bb2ee3b3d8949ac0a18d5d61f043 100644 --- a/RegularExpression.cxx +++ b/RegularExpression.cxx @@ -74,6 +74,38 @@ RegularExpression::RegularExpression (const RegularExpression& rxp) { this->regmlen = rxp.regmlen; // Copy remaining private data } +// operator= -- Copies the given regular expression. +RegularExpression& RegularExpression::operator= (const RegularExpression& rxp) +{ + if ( !rxp.program ) + { + this->program = 0; + return *this; + } + int ind; + this->progsize = rxp.progsize; // Copy regular expression size + this->program = new char[this->progsize]; // Allocate storage + for(ind=this->progsize; ind-- != 0;) // Copy regular expresion + this->program[ind] = rxp.program[ind]; + this->startp[0] = rxp.startp[0]; // Copy pointers into last + this->endp[0] = rxp.endp[0]; // Successful "find" operation + this->regmust = rxp.regmust; // Copy field + if (rxp.regmust != 0) { + char* dum = rxp.program; + ind = 0; + while (dum != rxp.regmust) { + ++dum; + ++ind; + } + this->regmust = this->program + ind; + } + this->regstart = rxp.regstart; // Copy starting index + this->reganch = rxp.reganch; // Copy remaining private data + this->regmlen = rxp.regmlen; // Copy remaining private data + + return *this; +} + // operator== -- Returns true if two regular expressions have the same // compiled program for pattern matching. bool RegularExpression::operator== (const RegularExpression& rxp) const { diff --git a/RegularExpression.hxx.in b/RegularExpression.hxx.in index 9a078443cc7fbc65219006d9d9e4f8eb1efe96cc..4411c0b418f70d06764fd95a11d5d23b480ee428 100644 --- a/RegularExpression.hxx.in +++ b/RegularExpression.hxx.in @@ -233,6 +233,11 @@ public: */ inline kwsys_stl::string::size_type end() const; + /** + * Copy the given regular expression. + */ + RegularExpression& operator= (const RegularExpression& rxp); + /** * Returns true if two regular expressions have the same * compiled program for pattern matching. diff --git a/kwsysDateStamp.cmake b/kwsysDateStamp.cmake index 25a329d6df47326c8c9b0d7f524ab4b2a20a73d0..3beef63ee3beb6b534178b0c965845a523a1fbb7 100644 --- a/kwsysDateStamp.cmake +++ b/kwsysDateStamp.cmake @@ -7,4 +7,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2008) SET(KWSYS_DATE_STAMP_MONTH 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 14) +SET(KWSYS_DATE_STAMP_DAY 16)