Changeset 1221


Ignore:
Timestamp:
Oct 13, 2010, 4:45:55 PM (13 years ago)
Author:
Peter Johansson
Message:

fix error_test.sh failure on Linux associated with problems in SVNException. Avoid returning const char* to temporary string. Perform arithmetic on int not int*.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/SVN.cc

    r1219 r1221  
    3838#include <subversion-1/svn_subst.h>
    3939
    40 #include <sstream>
    4140#include <string>
    4241
     
    4948  {
    5049    ref_count_ = new int(1);
     50    if (error_) {
     51      apr_size_t bufsize=255;
     52      char buf[255];
     53      msg_ = svn_err_best_message(error_, buf, bufsize);
     54    }
     55    if (msg.size()) {
     56      msg_ += msg;
     57    }
    5158  }
    5259
     
    6168  SVNException::~SVNException(void) throw()
    6269  {
    63     --ref_count_;
    64     if (!ref_count_) {
     70    --(*ref_count_);
     71    if (!(*ref_count_)) {
    6572      delete ref_count_;
    6673      ref_count_=NULL;
     
    7380  const char* SVNException::what(void) const throw()
    7481  {
    75     std::stringstream ss;
    76     if (error_) {
    77       apr_size_t bufsize=255;
    78       char buf[255];
    79       ss << svn_err_best_message(error_, buf, bufsize);
    80     }
    81     if (msg_.size()) {
    82       ss << msg_;
    83     }
    84    
    85     return ss.str().c_str();
     82    return msg_.c_str();
    8683  }
    8784
Note: See TracChangeset for help on using the changeset viewer.