diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-12-09 06:56:54 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-12-09 06:56:54 -0800 |
commit | 2ea79e9094475dfe36f9291d98765dfb74151155 (patch) | |
tree | 899733b688f2d6b43eb7935fa988c6a9a31bbd5b /lib.c | |
parent | ca77d171b8155212d8c95341b2aad6f97d970659 (diff) | |
download | txr-2ea79e9094475dfe36f9291d98765dfb74151155.tar.gz txr-2ea79e9094475dfe36f9291d98765dfb74151155.tar.bz2 txr-2ea79e9094475dfe36f9291d98765dfb74151155.zip |
Bugfix: incorrect less comparison for ranges.
* lib.c (less): Missing test for equality
before comparing to fields.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -3899,9 +3899,18 @@ tail: return tnil(lenl < lenr); } case RNG: - if (less(from(left), from(right))) - return t; - return less(to(left), to(right)); + { + val fl = from(left); + val fr = from(right); + + if (less(fl, fr)) + return t; + + if (equal(fl, fr)) + return less(to(left), to(right)); + + return nil; + } default: internal_error("unhandled case in less function"); } |