From 4247c9e2c2612394a5f4d63a65ba538f975906d4 Mon Sep 17 00:00:00 2001 From: Jose Date: Tue, 10 Nov 2009 05:30:26 +0100 Subject: Fixed 3962 - Berkeley DB, problems with unicode paths. --- cpp/src/IcePatch2Lib/Util.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cpp/src/IcePatch2Lib/Util.cpp') diff --git a/cpp/src/IcePatch2Lib/Util.cpp b/cpp/src/IcePatch2Lib/Util.cpp index 41d422e8556..ca2510a119c 100644 --- a/cpp/src/IcePatch2Lib/Util.cpp +++ b/cpp/src/IcePatch2Lib/Util.cpp @@ -280,7 +280,7 @@ IcePatch2::simplify(const string& path) } if(result == "/." || - (result.size() == 4 && isalpha(static_cast(result[0])) && result[1] == ':' && + (result.size() == 4 && IceUtilInternal::isAlpha(result[0]) && result[1] == ':' && result[2] == '/' && result[3] == '.')) { return result.substr(0, result.size() - 1); @@ -291,8 +291,8 @@ IcePatch2::simplify(const string& path) result.erase(result.size() - 2, 2); } - if(result == "/" || (result.size() == 3 && isalpha(static_cast(result[0])) && result[1] == ':' && - result[2] == '/')) + if(result == "/" || (result.size() == 3 && IceUtilInternal::isAlpha(result[0]) && result[1] == ':' && + result[2] == '/')) { return result; } @@ -315,7 +315,7 @@ IcePatch2::isRoot(const string& pa) { string path = simplify(pa); #ifdef _WIN32 - return path == "/" || path.size() == 3 && isalpha(static_cast(path[0])) && path[1] == ':' && + return path == "/" || path.size() == 3 && IceUtilInternal::isAlpha(path[0]) && path[1] == ':' && path[2] == '/'; #else return path == "/"; @@ -404,7 +404,6 @@ IcePatch2::rename(const string& fromPa, const string& toPa) const string toPath = simplify(toPa); IceUtilInternal::remove(toPath); // We ignore errors, as the file we are renaming to might not exist. - if(IceUtilInternal::rename(fromPath ,toPath) == -1) { throw "cannot rename `" + fromPath + "' to `" + toPath + "': " + IceUtilInternal::lastErrorToString(); @@ -1055,6 +1054,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G close(fd); const string pathBZ2Temp = path + ".bz2temp"; + FILE* stdioFile = IceUtilInternal::fopen(pathBZ2Temp, "wb"); if(fwrite(&compressedBytes[0], compressedLen, 1, stdioFile) != 1) { -- cgit v1.2.3