[BusyBox-cvs] CVS busybox/networking

CVS User andersen andersen at codepoet.org
Fri Oct 8 08:27:41 UTC 2004


Update of /var/cvs/busybox/networking
In directory nail:/tmp/cvs-serv11283/networking

Modified Files:
	wget.c 
Log Message:
Patch from Denis Vlasenko to fix a problem where
wget http://1.2.3.4/abc/ loses last '/'


--- /var/cvs/busybox/networking/wget.c	2004/04/14 17:51:24	1.74
+++ /var/cvs/busybox/networking/wget.c	2004/10/08 08:27:40	1.75
@@ -239,11 +239,15 @@
 
 	/* Guess an output filename */
 	if (!fname_out) {
-		fname_out =
+		// Dirty hack. Needed because bb_get_last_path_component
+		// will destroy trailing / by storing '\0' in last byte!
+		if(target.path[strlen(target.path)-1]!='/') {
+			fname_out =
 #ifdef CONFIG_FEATURE_WGET_STATUSBAR
-			curfile =
+				curfile =
 #endif
-			bb_get_last_path_component(target.path);
+				bb_get_last_path_component(target.path);
+		}
 		if (fname_out==NULL || strlen(fname_out)<1) {
 			fname_out =
 #ifdef CONFIG_FEATURE_WGET_STATUSBAR
@@ -850,7 +854,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$Id: wget.c,v 1.74 2004/04/14 17:51:24 andersen Exp $
+ *	$Id: wget.c,v 1.75 2004/10/08 08:27:40 andersen Exp $
  */
 
 



More information about the busybox-cvs mailing list