** Reset a cursor back to the state it was in when first returned ** by fsdirOpen(). */
| 2739 | ** by fsdirOpen(). |
| 2740 | */ |
| 2741 | static void fsdirResetCursor(fsdir_cursor *pCur){ |
| 2742 | int i; |
| 2743 | for(i=0; i<=pCur->iLvl; i++){ |
| 2744 | FsdirLevel *pLvl = &pCur->aLvl[i]; |
| 2745 | if( pLvl->pDir ) closedir(pLvl->pDir); |
| 2746 | sqlite3_free(pLvl->zDir); |
| 2747 | } |
| 2748 | sqlite3_free(pCur->zPath); |
| 2749 | sqlite3_free(pCur->aLvl); |
| 2750 | pCur->aLvl = 0; |
| 2751 | pCur->zPath = 0; |
| 2752 | pCur->zBase = 0; |
| 2753 | pCur->nBase = 0; |
| 2754 | pCur->nLvl = 0; |
| 2755 | pCur->iLvl = -1; |
| 2756 | pCur->iRowid = 1; |
| 2757 | } |
| 2758 | |
| 2759 | /* |
| 2760 | ** Destructor for an fsdir_cursor. |
no test coverage detected