Boost C++ Libraries: Ticket #4826: filesystem::path::operator/=(const value_type* next_p) https://svn.boost.org/trac10/ticket/4826 <p> It might be nice if the code checked if next_p+1 and next_p+2 existed before accessing them. The code in the iterator pair constructor immediately below does make the checks yet that seems to have failed to get into path::operator/=(const value_type* next_p) </p> <p> reported on 1.36 exists 1.44 filesystem/V2 </p> <p> template&lt;class String, class Traits&gt; basic_path&lt;String, Traits&gt;&amp; basic_path&lt;String, Traits&gt;::operator/=(const value_type* next_p ){ </p> <blockquote> <p> size_t len = typename String::traits_type::length(next_p); if(len!=0){ </p> <blockquote> <p> if(len&gt;=3){ </p> <blockquote> <p> if ( *next_p == slash&lt;path_type&gt;::value </p> <blockquote> <p> &amp;&amp; *(next_p+1) == slash&lt;path_type&gt;::value &amp;&amp; *(next_p+2) == colon&lt;path_type&gt;::value ) { </p> </blockquote> </blockquote> </blockquote> </blockquote> <p> </p> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <p> next_p += 3; </p> </blockquote> </blockquote> <p> } </p> </blockquote> <p> } </p> </blockquote> </blockquote> <p> </p> <blockquote> <blockquote> <blockquote> <p> <em> append slash&lt;path_type&gt;::value if needed if ( !empty() </em></p> <blockquote> <p> &amp;&amp; *next_p != 0 &amp;&amp; !detail::is_separator&lt;path_type&gt;( *next_p ) ){ </p> </blockquote> <p> m_append_separator_if_needed(); </p> </blockquote> <p> } </p> </blockquote> </blockquote> <blockquote> <blockquote> <blockquote> <p> for ( ; *next_p != 0; ++next_p ){ </p> <blockquote> <p> m_append( *next_p ); </p> </blockquote> <p> } </p> </blockquote> <p> } return *this; </p> </blockquote> <p> } </p> </blockquote> <p> OR EVEN </p> <p> template&lt;class String, class Traits&gt; basic_path&lt;String, Traits&gt;&amp; basic_path&lt;String, Traits&gt;::operator/=(const value_type* next_p ){ </p> <blockquote> <p> size_t len = typename String::traits_type::length(next_p); if (len) operator/=(next_p,next_p+len); return *this; </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4826 Trac 1.4.3 anonymous Tue, 09 Nov 2010 14:52:10 GMT <link>https://svn.boost.org/trac10/ticket/4826#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4826#comment:1</guid> <description> <p> please ignore - user error </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 27 Nov 2010 15:19:16 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4826#comment:2 https://svn.boost.org/trac10/ticket/4826#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> Closed as required. </p> Ticket