From 84e12faee35223a1fbc591a4a45a1b838e535e9e Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Fri, 14 Apr 2000 04:02:42 +0000 Subject: [PATCH] Thu Apr 13 21:15:03 PDT 2000 Michael Jennings Fixed an image loading problem. SVN revision: 2489 --- ChangeLog | 5 +++++ src/pixmap.c | 28 +++++++++++++++++----------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index a580d3a..530b73e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3483,3 +3483,8 @@ Wed Apr 12 21:46:41 PDT 2000 Michael Jennings Fixed auto mode problems. That was a really dumb oversight. ------------------------------------------------------------------------------- +Thu Apr 13 21:15:03 PDT 2000 Michael Jennings + + Fixed an image loading problem. + +------------------------------------------------------------------------------- diff --git a/src/pixmap.c b/src/pixmap.c index 0f24082..fe24dd1 100644 --- a/src/pixmap.c +++ b/src/pixmap.c @@ -348,16 +348,16 @@ reset_simage(simage_t * simg, unsigned long mask) D_PIXMAP(("reset_simage(%8p, 0x%08x)\n", simg, mask)); + if ((mask & RESET_PMAP_PIXMAP) && simg->pmap->pixmap != None) { + imlib_free_pixmap_and_mask(simg->pmap->pixmap); + simg->pmap->pixmap = None; + simg->pmap->mask = None; + } if ((mask & RESET_IMLIB_IM) && simg->iml->im) { imlib_context_set_image(simg->iml->im); imlib_free_image_and_decache(); simg->iml->im = NULL; } - if (((mask & RESET_PMAP_PIXMAP) && simg->pmap->pixmap != None) || ((mask & RESET_PMAP_MASK) && simg->pmap->mask != None)) { - imlib_free_pixmap_and_mask(simg->pmap->pixmap); - simg->pmap->pixmap = None; - simg->pmap->mask = None; - } if ((mask & RESET_IMLIB_BORDER) && simg->iml->border) { FREE(simg->iml->border); simg->iml->border = NULL; @@ -1135,16 +1135,22 @@ search_path(const char *pathlist, const char *file, const char *ext) ext = ""; } getcwd(name, PATH_MAX); + len = strlen(name); D_OPTIONS(("search_path(\"%s\", \"%s\", \"%s\") called from \"%s\".\n", pathlist, file, ext, name)); - D_OPTIONS(("Checking for file \"%s\"\n", file)); - if (!access(file, R_OK)) { - if (stat(file, &fst)) { - D_OPTIONS(("Unable to stat %s -- %s\n", file, strerror(errno))); + if (len < PATH_MAX - 1) { + strcat(name, "/"); + strncat(name, file, PATH_MAX - len - 1); + } + D_OPTIONS(("Checking for file \"%s\"\n", name)); + if (!access(name, R_OK)) { + if (stat(name, &fst)) { + D_OPTIONS(("Unable to stat %s -- %s\n", name, strerror(errno))); } else { D_OPTIONS(("Stat returned mode 0x%08o, S_ISDIR() == %d\n", fst.st_mode, S_ISDIR(fst.st_mode))); } - if (!S_ISDIR(fst.st_mode)) - return file; + if (!S_ISDIR(fst.st_mode)) { + return name; + } } if ((p = strchr(file, '@')) == NULL) p = strchr(file, '\0');