Jean-Marc Lasgouttes wrote:

> It is not to bad. Did you actually check that it fixes the gcc 4.1
> bug? If it does we should go this way.

I did (only bug 2677), with system boost 1.33 and a snapshot of 1.34cvs,
therefore the additional BOOST_VERSION stuff.
This patch is the bare minimum needed for boost 1.33 (assuming the
visit_each bug in boost is fixed).

> And then there is an huge boost patch, right?

Yes. Maybe one could simply do a svn delete of the whole boost directory and
copy it over from trunk?


Georg
Index: src/frontends/controllers/biblio.C
===================================================================
--- src/frontends/controllers/biblio.C	(Revision 14801)
+++ src/frontends/controllers/biblio.C	(Arbeitskopie)
@@ -376,13 +376,13 @@ string const escape_special_chars(string
 	// Note that '[' and '\' must be escaped.
 	// This is a limitation of boost::regex, but all other chars in BREs
 	// are assumed literal.
-	boost::RegEx reg("[].|*?+(){}^$\\[\\\\]");
+	boost::regex reg("[].|*?+(){}^$\\[\\\\]");
 
 	// $& is a perl-like expression that expands to all of the current match
 	// The '$' must be prefixed with the escape character '\' for
 	// boost to treat it as a literal.
 	// Thus, to prefix a matched expression with '\', we use:
-	return reg.Merge(expr, "\\\\$&");
+	return boost::regex_replace(expr, reg, "\\\\$&");
 }
 
 
@@ -409,14 +409,14 @@ public:
 
 		// Attempts to find a match for the current RE
 		// somewhere in data.
-		return regex_.Search(data);
+		return boost::regex_search(data, regex_);
 	}
 
 	bool validRE() const { return regex_.error_code() == 0; }
 
 private:
 	InfoMap const map_;
-	mutable boost::RegEx regex_;
+	mutable boost::regex regex_;
 };
 
 } // namespace anon
Index: src/support/filetools.C
===================================================================
--- src/support/filetools.C	(Revision 14801)
+++ src/support/filetools.C	(Arbeitskopie)
@@ -599,42 +599,16 @@ string const ExpandPath(string const & p
 // Also converts paths like /foo//bar ==> /foo/bar
 string const NormalizePath(string const & path)
 {
-	string TempBase;
-	string RTemp;
-	string Temp;
+	// Normalize paths like /foo//bar ==> /foo/bar
+	static boost::regex regex("/{2,}");
+	string const tmppath = boost::regex_merge(path, regex, "/");
 
-	if (os::is_absolute_path(path))
-		RTemp = path;
-	else
-		// Make implicit current directory explicit
-		RTemp = "./" + path;
+	fs::path const npath = fs::path(tmppath, fs::no_check).normalize();
 
-	// Normalise paths like /foo//bar ==> /foo/bar
-	boost::RegEx regex("/{2,}");
-	RTemp = regex.Merge(RTemp, "/");
-
-	while (!RTemp.empty()) {
-		// Split by next /
-		RTemp = split(RTemp, Temp, '/');
-
-		if (Temp == ".") {
-			TempBase = "./";
-		} else if (Temp == "..") {
-			// Remove one level of TempBase
-			string::difference_type i = TempBase.length() - 2;
-			while (i > 0 && TempBase[i] != '/')
-				--i;
-			if (i >= 0 && TempBase[i] == '/')
-				TempBase.erase(i + 1, string::npos);
-			else
-				TempBase = "../";
-		} else {
-			TempBase += Temp + '/';
-		}
-	}
+	if (!npath.is_complete())
+		return "./" + npath.string() + '/';
 
-	// returns absolute path
-	return TempBase;
+	return npath.string() + '/';
 }
 
 
Index: src/support/debugstream.h
===================================================================
--- src/support/debugstream.h	(Revision 14801)
+++ src/support/debugstream.h	(Arbeitskopie)
@@ -14,7 +14,13 @@
 
 #include <iostream>
 
-#include <boost/test/detail/nullstream.hpp>
+#include <boost/version.hpp>
+
+#if BOOST_VERSION < 103300
+#  include <boost/test/detail/nullstream.hpp>
+#else
+#  include <boost/test/utils/nullstream.hpp>
+#endif
 
 #ifdef DEBUG
 # define TEMPORARY_DEBUG_MACRO DEBUG

Reply via email to