diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2000-11-02 15:24:08 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2000-11-02 15:24:08 +0000 |
commit | 10575a842ab241e1727e0d428980cd0b48f5d21b (patch) | |
tree | f708b364949245d3ae5c630b38e140216b52be27 /file_io/win32/filedup.c | |
parent | f1c8829886e88887b7f48aa70ce24dcb74161313 (diff) | |
download | libapr-10575a842ab241e1727e0d428980cd0b48f5d21b.tar.gz |
The Unicode/WinNT APR patch. Note that this may even be faster than
MS's internal atow translation that always occurs. Enabled now by
default. Warning; it's probable that extended characters in existing
URL's are broken by the patch, since the URL semantic changes. Also,
launching cgi's, loading modules, etc that use extended characters are
also broken.
Step 2 is to address the cgi/CreateProcess (spawn) aspects of the patch,
fix dso/LoadModule handling, and accept a Unicode'd httpd.conf file, as
utf-8 is already legal in httpd.conf path specs, but difficult to use.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60625 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/win32/filedup.c')
-rw-r--r-- | file_io/win32/filedup.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c index 6e14473ad..fea11f248 100644 --- a/file_io/win32/filedup.c +++ b/file_io/win32/filedup.c @@ -66,9 +66,7 @@ apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t { BOOLEAN isStdHandle = FALSE; HANDLE hCurrentProcess = GetCurrentProcess(); -#if APR_HAS_UNICODE_FS - int len = wcslen(old_file->fname) + 1; -#endif + apr_oslevel_e os_level; if ((*new_file) == NULL) { if (p == NULL) { @@ -111,11 +109,16 @@ apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t (*new_file)->cntxt = old_file->cntxt; #if APR_HAS_UNICODE_FS - (*new_file)->fname = apr_palloc(old_file->cntxt, len * 2); - wcscpy((*new_file)->fname, old_file->fname); -#else - (*new_file)->fname = apr_pstrdup(old_file->cntxt, old_file->fname); + if (!apr_get_oslevel(old_file->cntxt, &os_level) && os_level >= APR_WIN_NT) + { + int len = wcslen(old_file->w.fname) + 1; + (*new_file)->w.fname = apr_palloc(old_file->cntxt, len * 2); + wcscpy((*new_file)->w.fname, old_file->w.fname); + } + else #endif + (*new_file)->n.fname = apr_pstrdup(old_file->cntxt, old_file->n.fname); + /* (*new_file)->demonfname = apr_pstrdup(old_file->cntxt, old_file->demonfname); * (*new_file)->lowerdemonfname = apr_pstrdup(old_file->cntxt, old_file->lowerdemonfname); */ |