** Reset a cursor back to the state it was in when first returned ** by fsdirOpen(). */
| 6104 | ** by fsdirOpen(). |
| 6105 | */ |
| 6106 | static void fsdirResetCursor(fsdir_cursor *pCur){ |
| 6107 | int i; |
| 6108 | for(i=0; i<=pCur->iLvl; i++){ |
| 6109 | FsdirLevel *pLvl = &pCur->aLvl[i]; |
| 6110 | if( pLvl->pDir ) closedir(pLvl->pDir); |
| 6111 | sqlite3_free(pLvl->zDir); |
| 6112 | } |
| 6113 | sqlite3_free(pCur->zPath); |
| 6114 | sqlite3_free(pCur->aLvl); |
| 6115 | pCur->aLvl = 0; |
| 6116 | pCur->zPath = 0; |
| 6117 | pCur->zBase = 0; |
| 6118 | pCur->nBase = 0; |
| 6119 | pCur->nLvl = 0; |
| 6120 | pCur->iLvl = -1; |
| 6121 | pCur->iRowid = 1; |
| 6122 | } |
| 6123 | |
| 6124 | /* |
| 6125 | ** Destructor for an fsdir_cursor. |
no test coverage detected