diff --git a/src/lib/automate/automate.c b/src/lib/automate/automate.c index 503f4b8..4461017 100644 --- a/src/lib/automate/automate.c +++ b/src/lib/automate/automate.c @@ -69,10 +69,9 @@ unsigned int browse(struct Automate* pAutomate, const char* pString, const char /* (1) Check current state choices */ dotmem[c] = pAutomate->dCurrent; dotPtr = pAutomate->dot[dotmem[c]]; - indexmem[c] = strIndex; + i = ( indexmem[c] == strIndex ) ? pathmem[c] : 0; + // indexmem[c] = strIndex; l = dotPtr.n; - i = pathmem[c]; - /* (2) If no more path for this branch -> exit */ @@ -197,7 +196,8 @@ unsigned int browse(struct Automate* pAutomate, const char* pString, const char pAutomate->path[c] = pAutomate->dCurrent; - pathmem[c] = 0; + indexmem[c] = strIndex; + pathmem[c] = 0; } @@ -452,8 +452,8 @@ void mergeAutomate(struct Automate* pMaster, const char pSlaveIndex){ /* (6) For each @pSlave duplicated dot, add dot's edges to @pMaster */ // {1} Direct out from @pSlave replacement // - (ADB&0x01) && printf(" OUT: direct link from MASTER.dot.%d to MASTER.dot.%d\n", dotOffset+pSlave->dots-1, pMaster->dot[dot].dot[edge]) ; - linkDots(pMaster, dotOffset+pSlave->dots-1, pMaster->dot[dot].dot[edge], DIRECT_T, 0); + (ADB&0x01) && printf(" OUT: direct link from MASTER.dot.%d to MASTER.dot.%d\n", dotOffset+pSlave->dFinal, pMaster->dot[dot].dot[edge]) ; + linkDots(pMaster, dotOffset+pSlave->dFinal, pMaster->dot[dot].dot[edge], DIRECT_T, 0); // {2} Direct link to @pSlave replacement // pMaster->dot[dot].type[edge] = DIRECT_T; diff --git a/src/lib/automate/automate.h b/src/lib/automate/automate.h index e112dac..46d0829 100644 --- a/src/lib/automate/automate.h +++ b/src/lib/automate/automate.h @@ -24,7 +24,7 @@ } AutomateType; - #define ADB 0x01 + #define ADB 0x00 struct AutomateDot{ char n; // number of edges