? .link_check.cpp.swp ? .link_check.hpp.swp Index: link_check.cpp =================================================================== RCS file: /cvsroot/boost/boost/tools/inspect/link_check.cpp,v retrieving revision 1.19 diff -u -r1.19 link_check.cpp --- link_check.cpp 23 Sep 2006 13:49:22 -0000 1.19 +++ link_check.cpp 23 Sep 2006 14:14:33 -0000 @@ -55,7 +55,8 @@ if (contents.find( "boostinspect:" "nounlinked" ) != string::npos) m_paths[ relative_to( full_path, fs::initial_path() ) ] |= m_nounlinked_errors; - if (contents.find( "boostinspect:" "nolink" ) != string::npos) return; + bool no_link_errors = + (contents.find( "boostinspect:" "nolink" ) != string::npos); string::const_iterator start( contents.begin() ); string::const_iterator end( contents.end() ); @@ -67,7 +68,7 @@ // what[0] contains the whole string iterators. // what[1] contains the URL iterators. do_url( string( what[1].first, what[1].second ), - library_name, full_path ); + library_name, full_path, no_link_errors ); start = what[0].second; // update search position flags |= boost::match_prev_avail; // update flags @@ -78,7 +79,8 @@ // do_url ------------------------------------------------------------------// void link_check::do_url( const string & url, const string & library_name, - const path & source_path ) // precondition: source_path.is_complete() + const path & source_path, bool no_link_errors ) + // precondition: source_path.is_complete() { if ( url[0] == '#' || url.find( "mailto:" ) == 0 @@ -91,13 +93,15 @@ if ( url.find( "file:" ) == 0 ) { - ++m_invalid_errors; - error( library_name, source_path, string(name()) + " invalid URL (hardwired file): " + url ); + if(!no_link_errors) { + ++m_invalid_errors; + error( library_name, source_path, string(name()) + " invalid URL (hardwired file): " + url ); + } return; } // detect characters banned by RFC2396: - if ( url.find_first_of( " <>\"{}|\\^[]'" ) != string::npos ) + if ( !no_link_errors && url.find_first_of( " <>\"{}|\\^[]'" ) != string::npos ) { ++m_invalid_errors; error( library_name, source_path, string(name()) + " invalid character in URL: " + url ); @@ -110,7 +114,7 @@ { plain_url.erase( pos ); // detect characters banned by RFC2396 in bookmark: - if ( url.find( '#', pos+1 ) != string::npos ) + if ( !no_link_errors && url.find( '#', pos+1 ) != string::npos ) { ++m_bookmark_errors; error( library_name, source_path, string(name()) + " invalid bookmark: " + url ); @@ -126,8 +130,10 @@ try { target_path = source_path.branch_path() /= path( plain_url, fs::no_check ); } catch ( const fs::filesystem_error & ) { - ++m_invalid_errors; - error( library_name, source_path, string(name()) + " invalid URL: " + url ); + if(!no_link_errors) { + ++m_invalid_errors; + error( library_name, source_path, string(name()) + " invalid URL: " + url ); + } return; } @@ -145,7 +151,7 @@ itr->second |= m_linked_to; // if target isn't present, the link is broken - if ( (itr->second & m_present) == 0 ) + if ( !no_link_errors && (itr->second & m_present) == 0 ) { ++m_broken_errors; error( library_name, source_path, string(name()) + " broken link: " + url ); Index: link_check.hpp =================================================================== RCS file: /cvsroot/boost/boost/tools/inspect/link_check.hpp,v retrieving revision 1.8 diff -u -r1.8 link_check.hpp --- link_check.hpp 23 Sep 2006 13:49:22 -0000 1.8 +++ link_check.hpp 23 Sep 2006 14:14:33 -0000 @@ -31,8 +31,8 @@ typedef std::map< string, int > m_path_map; m_path_map m_paths; // first() is relative initial_path() - void do_url( const string & url, - const string & library_name, const path & full_source_path ); + void do_url( const string & url, const string & library_name, + const path & full_source_path, bool no_link_errors ); public: link_check();