Modify

Opened 8 years ago

Closed 5 years ago

#3714 closed Bugs (fixed)

file_system::path::assign clears and appends, precluding assignment to a leading substring of self

Reported by: joe.pendergast@… Owned by: bemandawes
Milestone: Boost 1.42.0 Component: filesystem
Version: Boost 1.41.0 Severity: Problem
Keywords: path assign leading substring Cc:

Description

template <class InputIterator?> basic_path & assign( InputIterator? first, InputIterator? last )

{ m_path.clear(); append( first, last ); return *this; }

this implementation precludes assigning to a path a leading substring of that path itself because most impl's string_type::clear will end up setting the first char to 0. I could not find documentation that explicitly precludes this.

As stated most impl's will end up setting the first char to 0, so this seems to fix in those implementations:

{

typename string_type::value_type c; if(first!=last)c = *first; m_path.clear(); append( first, last ); if(first!=last) mPath[0] = c; return *this;

}

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by anonymous

m_path[0] = c;

comment:2 Changed 5 years ago by bemandawes

Fix by changeset https://svn.boost.org/trac/boost/search?q=76541

Thanks for the report!

--Beman

comment:3 Changed 5 years ago by bemandawes

  • Resolution set to fixed
  • Status changed from new to closed

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain bemandawes.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.