public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "H. J. Lu" <hjl@lucon.org>
To: dejagnu@gnu.org, rob@welcomehome.org
Cc: GDB <gdb@sources.redhat.com>,
	binutils@sources.redhat.com, gcc@gcc.gnu.org
Subject: PATCH: Fix "proc find" in dejagnu
Date: Mon, 19 May 2003 06:57:00 -0000	[thread overview]
Message-ID: <20030518235710.A10509@lucon.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 462 bytes --]

"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.

[-- Attachment #2: dejagnu-find.patch --]
[-- Type: text/plain, Size: 807 bytes --]

2003-05-19  H.J. Lu <hongjiu.lu@intel.com>

	* 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 {

             reply	other threads:[~2003-05-19  6:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-19  6:57 H. J. Lu [this message]
2003-05-19 15:54 ` Rob Savoye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030518235710.A10509@lucon.org \
    --to=hjl@lucon.org \
    --cc=binutils@sources.redhat.com \
    --cc=dejagnu@gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=gdb@sources.redhat.com \
    --cc=rob@welcomehome.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).