From ca38c6739721bb5f78005da21bd7ca6499c1e1c7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 9 Sep 2001 06:03:05 +0000 Subject: Fix the apr_proc_create for win32. In order to do so, this patch introduces a flags arg for apr_filepath_get(), like apr_filepath_merge(), that allows the APR_FILEPATH_NATIVE result format. This launches win32 processes with the Unicode semantics (although it runs sbcs apps equally well) and changes the default to 'not detached', in sync with the unix default. Finally, assures apr_filepath_get() uses the '/' semantics on OS2 by default. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62296 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/os2/filesys.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'file_io/os2/filesys.c') diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c index af55fbe8d..4f99c4867 100644 --- a/file_io/os2/filesys.c +++ b/file_io/os2/filesys.c @@ -100,7 +100,8 @@ apr_status_t filepath_root_test(char *path, apr_pool_t *p) } -apr_status_t filepath_drive_get(char **rootpath, char drive, apr_pool_t *p) +apr_status_t filepath_drive_get(char **rootpath, char drive, + apr_int32_t flags, apr_pool_t *p) { char path[APR_PATH_MAX]; char *pos; @@ -117,12 +118,11 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, apr_pool_t *p) return APR_FROM_OS_ERROR(rc); } - /* ###: We really should consider adding a flag to allow the user - * to have the APR_FILEPATH_NATIVE result - */ - for (pos=path; *pos; pos++) { - if (*pos == '\\') - *pos = '/'; + if (!(flags & APR_FILEPATH_NATIVE)) { + for (pos=path; *pos; pos++) { + if (*pos == '\\') + *pos = '/'; + } } *rootpath = apr_pstrdup(p, path); @@ -142,12 +142,14 @@ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) } -APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_pool_t *p) +APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_int32_t flags, + apr_pool_t *p) { char path[APR_PATH_MAX]; ULONG drive; ULONG drivemap; ULONG rv, pathlen = sizeof(path) - 3; + char *pos; DosQueryCurrentDisk(&drive, &drivemap); path[0] = '@' + drive; @@ -155,6 +157,14 @@ APR_DECLARE(apr_status_t) apr_filepath_get(char **defpath, apr_pool_t *p) rv = DosQueryCurrentDir(drive, path+3, &pathlen); *defpath = apr_pstrdup(p, path); + + if (!(flags & APR_FILEPATH_NATIVE)) { + for (pos=*defpath; *pos; pos++) { + if (*pos == '\\') + *pos = '/'; + } + } + return APR_SUCCESS; } -- cgit v1.2.3