summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index dbeb20a0..add50d30 100644
--- a/lib.c
+++ b/lib.c
@@ -4467,7 +4467,10 @@ val cmp_str(val astr, val bstr)
case TYPE_PAIR(STR, STR):
case TYPE_PAIR(LIT, STR):
case TYPE_PAIR(STR, LIT):
- return num(wcscmp(c_str(astr), c_str(bstr)));
+ {
+ int cmp = wcscmp(c_str(astr), c_str(bstr));
+ return if3(cmp < 0, negone, if3(cmp > 0, one, zero));
+ }
case TYPE_PAIR(LSTR, LIT):
case TYPE_PAIR(LSTR, STR):
case TYPE_PAIR(LIT, LSTR):