Re: [AD] possible bug in filetest. |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Eric Botcazou <ebotcazou@xxxxxxxxxx> wrote:
> > save the state of allegro_errno, use it, and then put back the old
state.
> > it's that simple.
>
> I don't really understand...
this is what i had in mind.
---
int old_errno;
old_errno = *allegro_errno; /* save state */
errno = *allegro_errno = 0; /* clear state */
do {
replace_filename(buf, name, info.name, sizeof(buf));
(*callback)(buf, info.attrib, param);
if (*allegro_errno)
break;
c++;
} while (!al_findnext(&info));
errno = *allegro_errno = old_errno; /* restore old state */
---
Sincerely Henrik Stokseth.
-----------------------------------------------------------------------
E-mail: hstokset@xxxxxxxxxx Homepage: http://hstokset.n3.net