httpd: trivial simplification

This commit is contained in:
Denis Vlasenko 2007-09-28 22:35:29 +00:00
parent ab8c9378c9
commit 3d2a9217a7

View File

@ -609,10 +609,12 @@ static void parse_conf(const char *path, int flag)
if (*p == '/') { if (*p == '/') {
if (*cf == '/') { /* skip duplicate (or initial) slash */ if (*cf == '/') { /* skip duplicate (or initial) slash */
continue; continue;
} else if (*cf == '.') { }
if (*cf == '.') {
if (cf[1] == '/' || cf[1] == '\0') { /* remove extra '.' */ if (cf[1] == '/' || cf[1] == '\0') { /* remove extra '.' */
continue; continue;
} else if ((cf[1] == '.') && (cf[2] == '/' || cf[2] == '\0')) { }
if ((cf[1] == '.') && (cf[2] == '/' || cf[2] == '\0')) {
++cf; ++cf;
if (p > p0) { if (p > p0) {
while (*--p != '/') /* omit previous dir */; while (*--p != '/') /* omit previous dir */;
@ -627,8 +629,8 @@ static void parse_conf(const char *path, int flag)
if ((p == p0) || (*p != '/')) { /* not a trailing slash */ if ((p == p0) || (*p != '/')) { /* not a trailing slash */
++p; /* so keep last character */ ++p; /* so keep last character */
} }
*p = '\0'; *p = ':';
sprintf(p0 + strlen(p0), ":%s", c); strcpy(p + 1, c);
} }
#endif #endif