httpd: trivial simplification
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Fri, 28 Sep 2007 22:35:29 +0000 (22:35 +0000)
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Fri, 28 Sep 2007 22:35:29 +0000 (22:35 +0000)
git-svn-id: svn://busybox.net/trunk/busybox@20108 69ca8d6d-28ef-0310-b511-8ec308f3f277

networking/httpd.c

index 92a0710..c8fbefd 100644 (file)
@@ -609,10 +609,12 @@ static void parse_conf(const char *path, int flag)
                                if (*p == '/') {
                                        if (*cf == '/') {    /* skip duplicate (or initial) slash */
                                                continue;
-                                       } else if (*cf == '.') {
+                                       }
+                                       if (*cf == '.') {
                                                if (cf[1] == '/' || cf[1] == '\0') { /* remove extra '.' */
                                                        continue;
-                                               } else if ((cf[1] == '.') && (cf[2] == '/' || cf[2] == '\0')) {
+                                               }
+                                               if ((cf[1] == '.') && (cf[2] == '/' || cf[2] == '\0')) {
                                                        ++cf;
                                                        if (p > p0) {
                                                                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 */
                                ++p;                             /* so keep last character */
                        }
-                       *p = '\0';
-                       sprintf(p0 + strlen(p0), ":%s", c);
+                       *p = ':';
+                       strcpy(p + 1, c);
                }
 #endif