[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
dfa.c:in_coll_range z/OS fixes
From: |
Aharon Robbins |
Subject: |
dfa.c:in_coll_range z/OS fixes |
Date: |
Tue, 06 Apr 2010 20:05:56 +0300 |
Hi. My z/OS maintainer indicates that in_coll_range() doesn't compile
there. He suggests the following patch:
*** dfa.c.orig Fri Apr 2 06:00:20 2010
--- dfa.c Fri Apr 2 05:59:38 2010
***************
*** 408,414 ****
--- 408,419 ----
static int
in_coll_range (char ch, char from, char to)
{
+ #ifdef ZOS_USS
+ char c[6] = { 0, 0, 0, 0, 0, 0 };
+ c[0] = from; c[2] = ch; c[4] = to;
+ #else
char c[6] = { from, 0, ch, 0, to, 0 };
+ #endif
return strcoll (&c[0], &c[2]) <= 0 && strcoll (&c[2], &c[4]) <= 0;
}
I rather prefer this one, since it's straightforward and clear:
Index: dfa.c
===================================================================
RCS file: /d/mongo/cvsrep/gawk-stable/dfa.c,v
retrieving revision 1.29
diff -u -r1.29 dfa.c
--- dfa.c 2 Apr 2010 09:33:41 -0000 1.29
+++ dfa.c 4 Apr 2010 12:29:47 -0000
@@ -408,7 +501,10 @@
static int
in_coll_range (char ch, char from, char to)
{
- char c[6] = { from, 0, ch, 0, to, 0 };
+ char c[6] = { 0, 0, 0, 0, 0, 0 };
+ c[0] = from;
+ c[2] = ch;
+ c[4] = to;
return strcoll (&c[0], &c[2]) <= 0 && strcoll (&c[2], &c[4]) <= 0;
}
Please let me know if either of these is acceptable.
Thanks,
Arnold
- dfa.c:in_coll_range z/OS fixes,
Aharon Robbins <=