1
0
mirror of https://github.com/apache/httpd.git synced 2025-09-02 13:21:21 +03:00

Optimize ap_make_dirstr_prefix().

Submitted by:	Manoj Kasichainula


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83781 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Roy T. Fielding
1999-08-26 16:37:41 +00:00
parent 3e46488a44
commit 08ef8a49fe

View File

@@ -553,15 +553,11 @@ API_EXPORT(void) ap_no2slash(char *name)
API_EXPORT(char *) ap_make_dirstr_prefix(char *d, const char *s, int n)
{
for (;;) {
*d = *s;
if (*d == '\0') {
if (*s == '\0' || (*s == '/' && (--n) == 0)) {
*d = '/';
break;
}
if (*d == '/' && (--n) == 0)
break;
++d;
++s;
*d++ = *s++;
}
*++d = 0;
return (d);