Patchwork [committed,gdb/testsuite] Fix typo in tcl_version_at_least

login
register
mail settings
Submitter Tom de Vries
Date Aug. 5, 2019, 10:53 a.m.
Message ID <bd79aa8e-bd14-32d3-a885-13c8dfd3006a@suse.de>
Download mbox | patch
Permalink /patch/33962/
State New
Headers show

Comments

Tom de Vries - Aug. 5, 2019, 10:53 a.m.
[ was: [committed][gdb/testsuite] Fix gdb.base/structs.exp timeout with
check-read1 ]

On 01-08-19 10:58, Tom de Vries wrote:
> +# Return 1 if tcl version used is at least MAJOR.MINOR
> +proc tcl_version_at_least { major minor } {
> +    global tcl_version
> +    regexp {^([0-9]+)\.([0-9]+)$} $tcl_version \
> +	dummy tcl_version_major tcl_version_minor
> +    if { $tcl_version_major > $major } {
> +        return 1
> +    } elseif { $tcl_version_major == $major \
> +		   && $tcl_version_major >= $minor } {
> +        return 1
> +    } else {
> +        return 0
> +    }
> +}

This fixes a typo in the previous commit.

Thanks,
- Tom

Patch

[gdb/testsuite] Fix typo in tcl_version_at_least

In tcl_version_at_least we compare a minor against a major version number:
...
    } elseif { $tcl_version_major == $major \
                  && $tcl_version_major >= $minor } {
...

Fix this by using $tcl_version_minor in the comparison instead.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-08-05  Tom de Vries  <tdevries@suse.de>

	* lib/gdb.exp (tcl_version_at_least): Fix typo.

---
 gdb/testsuite/lib/gdb.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 9ca34d8b15..6d16217f3b 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1111,7 +1111,7 @@  proc tcl_version_at_least { major minor } {
     if { $tcl_version_major > $major } {
         return 1
     } elseif { $tcl_version_major == $major \
-		   && $tcl_version_major >= $minor } {
+		   && $tcl_version_minor >= $minor } {
         return 1
     } else {
         return 0