summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-12-02 18:12:54 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-03 15:19:55 +0100
commit827430c8c0417396b3c1d2a049ccddb818c89646 (patch)
tree2b249c14dcbfb725469b4dd70c125d00486d2a84 /tools
parent1924d05e706e6308b4de3b6103ebb73976866d66 (diff)
Fold URE: Windows
...assuming the delayLoadHook in cli_ure/source/native/native_bootstrap.cxx is no longer necessary and loading of cppuhelper from the program dir cannot fail regardless in whatever scenario the cli_cppuhelper library itself is loaded. Change-Id: I13f32b327bca4cce9780864f5e57cdad3860afe5
Diffstat (limited to 'tools')
-rw-r--r--tools/source/misc/pathutils.cxx101
1 files changed, 0 insertions, 101 deletions
diff --git a/tools/source/misc/pathutils.cxx b/tools/source/misc/pathutils.cxx
index f4507d83c15c..0b3f172ee3ed 100644
--- a/tools/source/misc/pathutils.cxx
+++ b/tools/source/misc/pathutils.cxx
@@ -102,107 +102,6 @@ WCHAR * buildPath(
}
}
-WCHAR * resolveLink(WCHAR * path) {
- HANDLE h = CreateFileW(
- path, FILE_READ_DATA, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
- if (h == INVALID_HANDLE_VALUE) {
- return NULL;
- }
- char p1[MAX_PATH];
- DWORD n;
- BOOL ok = ReadFile(h, p1, MAX_PATH, &n, NULL);
- CloseHandle(h);
- if (!ok) {
- return NULL;
- }
- WCHAR p2[MAX_PATH];
- std::size_t n2 = 0;
- bool colon = false;
- for (DWORD i = 0; i < n;) {
- unsigned char c = static_cast< unsigned char >(p1[i++]);
- switch (c) {
- case '\0':
- SetLastError(ERROR_BAD_PATHNAME);
- return NULL;
- case '\x0A':
- case '\x0D':
- if (n2 == MAX_PATH) {
- SetLastError(ERROR_FILENAME_EXCED_RANGE);
- return NULL;
- }
- p2[n2] = L'\0';
- break;
- case ':':
- colon = true;
- // fall through
- default:
- // Convert from UTF-8 to UTF-16:
- if (c <= 0x7F) {
- p2[n2++] = c;
- } else if (c >= 0xC2 && c <= 0xDF && i < n &&
- static_cast< unsigned char >(p1[i]) >= 0x80 &&
- static_cast< unsigned char >(p1[i]) <= 0xBF)
- {
- p2[n2++] = ((c & 0x1F) << 6) |
- (static_cast< unsigned char >(p1[i++]) & 0x3F);
- } else if (n - i > 1 &&
- ((c == 0xE0 &&
- static_cast< unsigned char >(p1[i]) >= 0xA0 &&
- static_cast< unsigned char >(p1[i]) <= 0xBF) ||
- (((c >= 0xE1 && c <= 0xEC) || (c >= 0xEE && c <= 0xEF)) &&
- static_cast< unsigned char >(p1[i]) >= 0x80 &&
- static_cast< unsigned char >(p1[i]) <= 0xBF) ||
- (c == 0xED &&
- static_cast< unsigned char >(p1[i]) >= 0x80 &&
- static_cast< unsigned char >(p1[i]) <= 0x9F)) &&
- static_cast< unsigned char >(p1[i + 1]) >= 0x80 &&
- static_cast< unsigned char >(p1[i + 1]) <= 0xBF)
- {
- p2[n2++] = ((c & 0x0F) << 12) |
- ((static_cast< unsigned char >(p1[i]) & 0x3F) << 6) |
- (static_cast< unsigned char >(p1[i + 1]) & 0x3F);
- i += 2;
- } else if (n - 2 > 1 &&
- ((c == 0xF0 &&
- static_cast< unsigned char >(p1[i]) >= 0x90 &&
- static_cast< unsigned char >(p1[i]) <= 0xBF) ||
- (c >= 0xF1 && c <= 0xF3 &&
- static_cast< unsigned char >(p1[i]) >= 0x80 &&
- static_cast< unsigned char >(p1[i]) <= 0xBF) ||
- (c == 0xF4 &&
- static_cast< unsigned char >(p1[i]) >= 0x80 &&
- static_cast< unsigned char >(p1[i]) <= 0x8F)) &&
- static_cast< unsigned char >(p1[i + 1]) >= 0x80 &&
- static_cast< unsigned char >(p1[i + 1]) <= 0xBF &&
- static_cast< unsigned char >(p1[i + 2]) >= 0x80 &&
- static_cast< unsigned char >(p1[i + 2]) <= 0xBF)
- {
- sal_Int32 u = ((c & 0x07) << 18) |
- ((static_cast< unsigned char >(p1[i]) & 0x3F) << 12) |
- ((static_cast< unsigned char >(p1[i + 1]) & 0x3F) << 6) |
- (static_cast< unsigned char >(p1[i + 2]) & 0x3F);
- i += 3;
- p2[n2++] = static_cast< WCHAR >(((u - 0x10000) >> 10) | 0xD800);
- p2[n2++] = static_cast< WCHAR >(
- ((u - 0x10000) & 0x3FF) | 0xDC00);
- } else {
- SetLastError(ERROR_BAD_PATHNAME);
- return NULL;
- }
- break;
- }
- }
- WCHAR * end;
- if (colon || p2[0] == L'\\') {
- // Interpret p2 as an absolute path:
- end = path;
- } else {
- // Interpret p2 as a relative path:
- end = filename(path);
- }
- return buildPath(path, path, end, p2, n2);
-}
-
}
#endif