This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 3d1396ad2aa8763807e048d91cde205e764b237f (commit) from 458bf7bf0abdd984b499c4deadc7551232108c5e (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/3d1396ad2aa8763807e048d91cde205e764b2...
commit 3d1396ad2aa8763807e048d91cde205e764b237f Author: Cyril Hrubis metan@ucw.cz Date: Sat Dec 29 00:22:20 2012 +0100
loaders: GP_Load: Add check for directory.
diff --git a/libs/loaders/GP_Loader.c b/libs/loaders/GP_Loader.c index fdd2641..05b1240 100644 --- a/libs/loaders/GP_Loader.c +++ b/libs/loaders/GP_Loader.c @@ -29,6 +29,9 @@ #include <string.h> #include <unistd.h> #include <errno.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h>
#include "core/GP_Debug.h"
@@ -230,7 +233,17 @@ static const GP_Loader *loader_by_signature(const char *path) GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback) { int saved_errno; - + struct stat st; + + if (stat(src_path, &st)) { + GP_WARN("Failed to stat '%s': %s", src_path, strerror(errno)); + } else { + if (st.st_mode & S_IFDIR) { + errno = EISDIR; + return NULL; + } + } + if (access(src_path, R_OK)) { saved_errno = errno; @@ -242,7 +255,7 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback) return NULL; } - + GP_Context *img; const GP_Loader *ext_load = NULL, *sig_load;
-----------------------------------------------------------------------
Summary of changes: libs/loaders/GP_Loader.c | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.