svn commit: trunk/busybox/networking

vda at busybox.net vda at busybox.net
Fri Sep 28 22:35:32 UTC 2007


Author: vda
Date: 2007-09-28 15:35:29 -0700 (Fri, 28 Sep 2007)
New Revision: 20108

Log:
httpd: trivial simplification



Modified:
   trunk/busybox/networking/httpd.c


Changeset:
Modified: trunk/busybox/networking/httpd.c
===================================================================
--- trunk/busybox/networking/httpd.c	2007-09-28 22:20:27 UTC (rev 20107)
+++ trunk/busybox/networking/httpd.c	2007-09-28 22:35:29 UTC (rev 20108)
@@ -609,10 +609,12 @@
 				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 @@
 			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
 




More information about the busybox-cvs mailing list