summaryrefslogtreecommitdiff
path: root/ecs.c
diff options
context:
space:
mode:
authorVern Paxson <vern@ee.lbl.gov>1990-03-14 13:39:41 +0000
committerVern Paxson <vern@ee.lbl.gov>1990-03-14 13:39:41 +0000
commit99ed9836390f8fc31923e0d2e2208e462a2a4d06 (patch)
tree2228d0ab50acb41a7f304669a05f674e6391ff0e /ecs.c
parentf248f2d111793b35a158d9c52e5c9b892ce5a5bc (diff)
Tweaks for NUL chars.
Diffstat (limited to 'ecs.c')
-rw-r--r--ecs.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ecs.c b/ecs.c
index d5ac84b..c7ca3bb 100644
--- a/ecs.c
+++ b/ecs.c
@@ -80,15 +80,18 @@ ccl2ecl()
*
* synopsis
* int cre8ecs();
- * number of classes = cre8ecs( fwd, bck, num );
+ * number of classes = cre8ecs( fwd, bck, num, start_pos );
*
* fwd is the forward linked-list of equivalence class members. bck
* is the backward linked-list, and num is the number of class members.
+ * start_pos is 0 if the class members begin in fwd[] and bck[] at
+ * position 0, and 1 if they begin at position 1.
+ *
* Returned is the number of classes.
*/
-int cre8ecs( fwd, bck, num )
-int fwd[], bck[], num;
+int cre8ecs( fwd, bck, num, start_pos )
+int fwd[], bck[], num, start_pos;
{
int i, j, numcl;
@@ -101,7 +104,7 @@ int fwd[], bck[], num;
* class.
*/
- for ( i = 1; i <= num; ++i )
+ for ( i = start_pos; i < num + start_pos; ++i )
if ( bck[i] == NIL )
{
bck[i] = ++numcl;
@@ -129,7 +132,7 @@ int ecmap[];
{
int i;
- for ( i = 1; i <= csize; ++i )
+ for ( i = (uses_NUL ? 0 : 1); i < csize; ++i )
if ( xlation[i] == 0 )
ecmap[i] = num_xlations + 1;
else