summaryrefslogtreecommitdiffstats
path: root/image.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-08-18 00:38:55 +0200
committerBert <ber.t@gmx.com>2011-08-18 00:38:55 +0200
commitff013dd0092df247b2c9f1c550e03542581ed21d (patch)
tree572777f9576c65c63a6f520e3b8b5b85edf5d580 /image.c
parent2a3a9657d360a4952ef84aa4e8665f211d490321 (diff)
downloadnsxiv-ff013dd0092df247b2c9f1c550e03542581ed21d.tar.zst
Revised handling of file names & paths
Diffstat (limited to 'image.c')
-rw-r--r--image.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/image.c b/image.c
index c9e53de..75fe989 100644
--- a/image.c
+++ b/image.c
@@ -50,12 +50,12 @@ void img_init(img_t *img, win_t *win) {
}
}
-int img_load(img_t *img, const char *filename) {
- if (!img || !filename)
+int img_load(img_t *img, const fileinfo_t *file) {
+ if (!img || !file || !file->name || !file->path)
return 0;
- if (access(filename, R_OK) || !(img->im = imlib_load_image(filename))) {
- warn("could not open image: %s", filename);
+ if (access(file->path, R_OK) || !(img->im = imlib_load_image(file->path))) {
+ warn("could not open image: %s", file->name);
return 0;
}