From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29316 invoked by alias); 19 May 2003 06:57:11 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 29191 invoked from network); 19 May 2003 06:57:11 -0000 Received: from unknown (HELO sccrmhc02.attbi.com) (204.127.202.62) by sources.redhat.com with SMTP; 19 May 2003 06:57:11 -0000 Received: from lucon.org (12-234-88-5.client.attbi.com[12.234.88.5]) by attbi.com (sccrmhc02) with ESMTP id <2003051906571000200hc2k7e>; Mon, 19 May 2003 06:57:10 +0000 Received: by lucon.org (Postfix, from userid 1000) id 0A80D2C683; Sun, 18 May 2003 23:57:10 -0700 (PDT) Date: Mon, 19 May 2003 06:57:00 -0000 From: "H. J. Lu" To: dejagnu@gnu.org, rob@welcomehome.org Cc: GDB , binutils@sources.redhat.com, gcc@gcc.gnu.org Subject: PATCH: Fix "proc find" in dejagnu Message-ID: <20030518235710.A10509@lucon.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-SW-Source: 2003-05/txt/msg00263.txt.bz2 --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 462 "proc find" is using "getdirs -all" incorrectly. When "getdirs -all" is used, there is no need to try to get all directories yourselves. The current "proc find" will list any file not in the root directory twice. This patch should fix it. BTW, is anyone working on dejagnu? I have found and fixed 3 bugs in less than 2 weeks since I was forced to use dejagnu 1.4.3. I didn't get any reponses nor any indications those bugs would be fixed any time soon. H.J. --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dejagnu-find.patch" Content-length: 807 2003-05-19 H.J. Lu * lib/utils.exp (find): Correctly use [getdirs -all $rootdir]. --- dejagnu/lib/utils.exp.recursive 2002-08-29 20:54:53.000000000 -0700 +++ dejagnu/lib/utils.exp 2003-05-18 23:42:17.000000000 -0700 @@ -97,25 +97,7 @@ proc getdirs { args } { # proc find { rootdir pattern } { # first find all the directories - set dirs "$rootdir " - while 1 { - set tmp $rootdir - set rootdir "" - if [string match "" $tmp] { - break - } - foreach i $tmp { - set j [getdirs -all $i] - if ![string match "" $j] { - append dirs "$j " - set rootdir $j - unset j - } else { - set rootdir "" - } - } - set tmp "" - } + set dirs "$rootdir [getdirs -all $rootdir]" # find all the files that match the pattern foreach i $dirs { --y0ulUmNC+osPPQO6--