diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2004-06-28 18:06:48 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2004-06-28 18:06:48 +0000 |
commit | 9025abc652d6a873159410cdb5d897a7a57c2dc3 (patch) | |
tree | 35e20b7c6f178576510f91acf0641b0c58a20389 /file_io | |
parent | 5caf3f40824dbe716112f591a57d580857e7d3ad (diff) | |
download | libapr-9025abc652d6a873159410cdb5d897a7a57c2dc3.tar.gz |
Simplify excessive copies when the string isn't transformed to upper.
Backport of rev 1.10
Reviewed by: trawick
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/APR_0_9_BRANCH@65225 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r-- | file_io/os2/filesys.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/file_io/os2/filesys.c b/file_io/os2/filesys.c index b323e488d..ef597b38e 100644 --- a/file_io/os2/filesys.c +++ b/file_io/os2/filesys.c @@ -94,12 +94,13 @@ apr_status_t filepath_drive_get(char **rootpath, char drive, apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p) { - char path[APR_PATH_MAX]; - - strcpy(path, root); - if (path[1] == ':') - path[0] = apr_toupper(path[0]); - *rootpath = apr_pstrdup(p, path); + if (root[0] && apr_islower(root[0]) && root[1] == ':') { + *rootpath = apr_pstrdup(p, root); + (*rootpath)[0] = apr_toupper((*rootpath)[0]); + } + else { + *rootpath = root; + } return APR_SUCCESS; } |