oooooooooooooooops

fix fix fix bug bug :)


SVN revision: 4678
This commit is contained in:
Carsten Haitzler 2001-04-29 02:55:55 +00:00
parent 895027d9fe
commit 22cdb56e43
1 changed files with 43 additions and 42 deletions

View File

@ -1118,6 +1118,28 @@ __imlib_LoadImage(const char *file, ImlibProgressFunction progress,
l->load(im, progress, progress_granularity, immediate_load);
/* if it failed - advance */
if (im->w == 0)
{
previous_l = l;
l = l->next;
}
}
/* if we have a loader then its the loader that succeeded */
/* move the successful loader to the head of the list */
/* as long as it's not alreayd at the head of the list */
if ((l) && (previous_l))
{
im->loader = l;
previous_l->next = l->next;
l->next = loaders;
loaders = l;
}
if (im->w > 0) im->loader = l;
}
else
im->loader = best_loader;
/* all loaders have been tried and they all failed. free the skeleton */
/* image struct we had and return NULL */
if (im->w == 0)
{
/* if the caller wants an error return */
if (er)
@ -1161,27 +1183,6 @@ __imlib_LoadImage(const char *file, ImlibProgressFunction progress,
}
errno = 0;
}
previous_l = l;
l = l->next;
}
}
/* if we have a loader then its the loader that succeeded */
/* move the successful loader to the head of the list */
/* as long as it's not alreayd at the head of the list */
if ((l) && (previous_l))
{
im->loader = l;
previous_l->next = l->next;
l->next = loaders;
loaders = l;
}
}
else
im->loader = best_loader;
/* all loaders have been tried and they all failed. free the skeleton */
/* image struct we had and return NULL */
if (im->w == 0)
{
__imlib_ConsumeImage(im);
return NULL;
}