Return-Path: Delivered-To: apmail-apr-cvs-archive@www.apache.org Received: (qmail 47693 invoked from network); 28 Jun 2004 18:07:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 28 Jun 2004 18:07:04 -0000 Received: (qmail 64238 invoked by uid 500); 28 Jun 2004 18:07:08 -0000 Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 64088 invoked by uid 500); 28 Jun 2004 18:07:05 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 63959 invoked by uid 99); 28 Jun 2004 18:07:03 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Date: 28 Jun 2004 18:06:48 -0000 Message-ID: <20040628180648.47571.qmail@minotaur.apache.org> From: wrowe@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/file_io/os2 filesys.c X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N wrowe 2004/06/28 11:06:48 Modified: file_io/os2 Tag: APR_0_9_BRANCH filesys.c Log: Simplify excessive copies when the string isn't transformed to upper. Backport of rev 1.10 Reviewed by: trawick Revision Changes Path No revision No revision 1.8.2.2 +7 -6 apr/file_io/os2/filesys.c Index: filesys.c =================================================================== RCS file: /home/cvs/apr/file_io/os2/filesys.c,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -u -r1.8.2.1 -r1.8.2.2 --- filesys.c 13 Feb 2004 09:33:42 -0000 1.8.2.1 +++ filesys.c 28 Jun 2004 18:06:48 -0000 1.8.2.2 @@ -94,12 +94,13 @@ 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; }