Fixes bug in isdfa
Fixes bug in isdfa

fsm_isdfa will return that a graph is a DFA is the first edge has no
duplicates.

The problem is in this loop:

 1      for (e = set_first(state->edges, &it); e != NULL; e = set_next(&it)) {
 2      	if (e->symbol > UCHAR_MAX) {
 3      		break;
 4      	}
 5
 6      	if (set_empty(e->sl)) {
 7      		continue;
 8      	}
 9
10      	(void) set_first(e->sl, &it);
11      	if (set_hasnext(&it)) {
12      		return 0;
13      	}
14      }

Lines 10 and 11 use the same iterator as the for loop at L1.  If the
condition on L11 is true, this will short-circuit the for-loop.  Thus,
if the first edge has no duplicates, fsm_isdfa will return true,
regardless of later edges.

This commit fixes the test in tests/isdfa/nfa0.fsm, which now passes.

katef/libfsm,katef/libfsm,katef/libfsm,katef/libfsm,katef/libfsm