From owner-freebsd-bugs Wed Dec 13 9:30: 7 2000 From owner-freebsd-bugs@FreeBSD.ORG Wed Dec 13 09:30:01 2000 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 51E7337B402 for ; Wed, 13 Dec 2000 09:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id eBDHU1653221; Wed, 13 Dec 2000 09:30:01 -0800 (PST) (envelope-from gnats) Resent-Date: Wed, 13 Dec 2000 09:30:01 -0800 (PST) Resent-Message-Id: <200012131730.eBDHU1653221@freefall.freebsd.org> Resent-From: gnats-admin@FreeBSD.org (GNATS Management) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: gnats-admin@FreeBSD.org, root@yoda.fwe.pi.musin.de Received: from yoda.fwe.pi.musin.de (yoda.fwe.pi.musin.de [194.246.250.18]) by hub.freebsd.org (Postfix) with ESMTP id 2378B37B400 for ; Wed, 13 Dec 2000 09:23:33 -0800 (PST) Received: (from root@localhost) by yoda.fwe.pi.musin.de (8.11.1/8.11.1) id eBDHNsH20581; Wed, 13 Dec 2000 18:23:55 +0100 (CET) (envelope-from sec) Message-Id: <200012131723.eBDHNsH20581@yoda.fwe.pi.musin.de> Date: Wed, 13 Dec 2000 18:23:55 +0100 (CET) From: root@yoda.fwe.pi.musin.de Sender: sec@yoda.fwe.pi.musin.de Reply-To: root@yoda.fwe.pi.musin.de To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/23526: Patch for bin/9529 (ftp completion cant handle spaces) Resent-Sender: gnats@FreeBSD.org Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 23526 >Category: bin >Synopsis: Patch for bin/9529 (ftp completion cant handle spaces) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Dec 13 09:30:00 PST 2000 >Closed-Date: >Last-Modified: >Originator: Charlie & >Release: FreeBSD 4.2-STABLE i386 >Organization: >Environment: >Description: As described in bin/9529 /usr/bin/ftp doesn't handle spaces in filenames. This PR is quite old and nobody did anything. So i tried to improve the situation by submitting a patch to fix this. >How-To-Repeat: >Fix: cvs diff: Diffing . Index: complete.c =================================================================== RCS file: /home/ncvs/src/usr.bin/ftp/complete.c,v retrieving revision 1.5 diff -b -u -r1.5 complete.c --- complete.c 1999/08/28 01:01:30 1.5 +++ complete.c 2000/12/13 17:21:11 @@ -82,7 +82,7 @@ int list; StringList *words; { - char insertstr[MAXPATHLEN]; + char insertstr[2*MAXPATHLEN]; char *lastmatch; int i, j; size_t matchlen, wordlen; @@ -92,7 +92,12 @@ return (CC_ERROR); /* no choices available */ if (words->sl_cur == 1) { /* only once choice available */ - (void)strcpy(insertstr, words->sl_str[0]); + for (i=0,j=0;isl_str[0]);i++,j++){ + if (isspace(words->sl_str[0][i])) + insertstr[j++]='\\'; + insertstr[j]=words->sl_str[0][i]; + }; + insertstr[j]=0; if (el_insertstr(el, insertstr + wordlen) == -1) return (CC_ERROR); else >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message