Path builder working buffer has to be reinitialized every loop iteration, to clean it up from trash.
This commit is contained in:
parent
52d9616503
commit
3ed00e610f
@ -2890,12 +2890,12 @@ PH7_PRIVATE void *PH7_StreamOpenHandle(ph7_vm *pVm, const ph7_io_stream *pStream
|
|||||||
#else
|
#else
|
||||||
static const int c = '/';
|
static const int c = '/';
|
||||||
#endif
|
#endif
|
||||||
/* Init the path builder working buffer */
|
|
||||||
SyBlobInit(&sWorker, &pVm->sAllocator);
|
|
||||||
/* Build a path from the set of include path */
|
/* Build a path from the set of include path */
|
||||||
SySetResetCursor(&pVm->aPaths);
|
SySetResetCursor(&pVm->aPaths);
|
||||||
rc = SXERR_IO;
|
rc = SXERR_IO;
|
||||||
while(SXRET_OK == SySetGetNextEntry(&pVm->aPaths, (void **)&pPath)) {
|
while(SXRET_OK == SySetGetNextEntry(&pVm->aPaths, (void **)&pPath)) {
|
||||||
|
/* Init the path builder working buffer everytime to avoid trash */
|
||||||
|
SyBlobInit(&sWorker, &pVm->sAllocator);
|
||||||
/* Build full path */
|
/* Build full path */
|
||||||
SyBlobFormat(&sWorker, "%z%c%z", pPath, c, &sFile);
|
SyBlobFormat(&sWorker, "%z%c%z", pPath, c, &sFile);
|
||||||
/* Append null terminator */
|
/* Append null terminator */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user