Overview
| Artifact ID: | a6e134000cb543e9f805f22774d47edce9c565c0 |
|---|---|
| Ticket: | 218593ffffffffffffffffffffffffffffffffff
string compare fails if preceded by expr |
| User & Date: | nobody on 2000-10-26 01:02:53 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 1380 Bug Version: 8.0.3 SubmitDate: '1999-03-02' LastModified: '1999-08-07' Severity: MED Status: Released Submitter: pat ChangedBy: hobbs OS: Solaris OSVersion: SunOS 5.6 Machine: Other FixedDate: '1999-08-07' FixedInVersion: 8.0.5 ClosedDate: '2000-10-25' Name: Ivan Prock Extensions: none CustomShell: none ReproducibleScript: set tcl_traceExec 3 set month 01 set day 08 # if the expr statement is commented-out, the [string compare] returns 1, # otherwise we get the incorrect -1 because "01" gets converted to "1" if {[expr $month < 01]} {} puts "day = \[$day\]" set x [string compare $day 01] puts "x = $x" exit 0; ObservedBehavior: 1: (18) invoking "info" "patchlevel" 1: (20) invoking "puts" "8.0.3" 8.0.3 Executing ByteCode 0x8b508, ref ct 2, epoch 0, interp 0x83e60(epoch 0) Source: "1 < 1" Cmds 0, chars 5, inst 6, objs 1, aux 0, stk depth 2, code/src 28.80n = 104(header)+6(inst)+24(objs)+0(exc)+0(aux)+0(cmd map) Starting stack top=-1 1: (70) invoking "puts" "day = [08]" day = [08] 1: (84) invoking "string" "compare" "08" "1" 1: (97) invoking "puts" "x = -1" x = -1 1: (104) invoking "exit" "0" DesiredBehavior: the string compare's behaviour shouldn't be affected by a previous command This was a bug related to an overaggressive object compiler that has since been fixed. -- 08/07/1999 hobbs - foundin changed to: "obsolete: 8.0.3"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "69. Other"
- title changed to: "string compare fails if preceded by expr"
- type changed to: "Bug"