PATCH: Fix "proc find" in dejagnu
H. J. Lu
hjl@lucon.org
Mon May 19 06:57:00 GMT 2003
"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.
-------------- next part --------------
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 {
More information about the Gdb
mailing list