Ticket #5118: replace_ext_fix.patch

File replace_ext_fix.patch, 721 bytes (added by bitfield.alex@…, 11 years ago)

Here is a patch for replace_extension method

  • path.cpp

     
    225225    size_type pos(m_pathname.rfind(dot));
    226226    if (pos != string_type::npos && pos >= filename_pos(m_pathname, m_pathname.size()))
    227227      m_pathname.erase(pos);
     228   
     229    if (!source.empty())
     230    {
     231      // append source extension
     232      if (source.m_pathname[0] != dot)
     233        m_pathname.push_back(dot);
     234      m_pathname.append(source.m_pathname);
     235    }
    228236
    229     // append source extension if any
    230     pos = source.m_pathname.rfind(dot);
    231     if (pos != string_type::npos)
    232       m_pathname += source.c_str() + pos;
    233 
    234237    return *this;
    235238  }
    236239