diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-28 22:35:29 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-28 22:35:29 +0000 |
| commit | 3d2a9217a7d06d167d722cb4eabf7a29232d7bcd (patch) | |
| tree | d5945c51fde3158c6f7e614393761355094c30e5 | |
| parent | ab8c9378c93168fcf3f3d7b87089cdc7884880cd (diff) | |
| download | busybox-w32-3d2a9217a7d06d167d722cb4eabf7a29232d7bcd.tar.gz busybox-w32-3d2a9217a7d06d167d722cb4eabf7a29232d7bcd.tar.bz2 busybox-w32-3d2a9217a7d06d167d722cb4eabf7a29232d7bcd.zip | |
httpd: trivial simplification
| -rw-r--r-- | networking/httpd.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 92a07107d..c8fbefd5a 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
| @@ -609,10 +609,12 @@ static void parse_conf(const char *path, int flag) | |||
| 609 | if (*p == '/') { | 609 | if (*p == '/') { |
| 610 | if (*cf == '/') { /* skip duplicate (or initial) slash */ | 610 | if (*cf == '/') { /* skip duplicate (or initial) slash */ |
| 611 | continue; | 611 | continue; |
| 612 | } else if (*cf == '.') { | 612 | } |
| 613 | if (*cf == '.') { | ||
| 613 | if (cf[1] == '/' || cf[1] == '\0') { /* remove extra '.' */ | 614 | if (cf[1] == '/' || cf[1] == '\0') { /* remove extra '.' */ |
| 614 | continue; | 615 | continue; |
| 615 | } else if ((cf[1] == '.') && (cf[2] == '/' || cf[2] == '\0')) { | 616 | } |
| 617 | if ((cf[1] == '.') && (cf[2] == '/' || cf[2] == '\0')) { | ||
| 616 | ++cf; | 618 | ++cf; |
| 617 | if (p > p0) { | 619 | if (p > p0) { |
| 618 | while (*--p != '/') /* omit previous dir */; | 620 | while (*--p != '/') /* omit previous dir */; |
| @@ -627,8 +629,8 @@ static void parse_conf(const char *path, int flag) | |||
| 627 | if ((p == p0) || (*p != '/')) { /* not a trailing slash */ | 629 | if ((p == p0) || (*p != '/')) { /* not a trailing slash */ |
| 628 | ++p; /* so keep last character */ | 630 | ++p; /* so keep last character */ |
| 629 | } | 631 | } |
| 630 | *p = '\0'; | 632 | *p = ':'; |
| 631 | sprintf(p0 + strlen(p0), ":%s", c); | 633 | strcpy(p + 1, c); |
| 632 | } | 634 | } |
| 633 | #endif | 635 | #endif |
| 634 | 636 | ||
