summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-04-04 20:35:10 +0200
committerBert <ber.t@gmx.com>2011-04-04 20:35:10 +0200
commit8d4e3a57ab93429ca8c3e8e9b1cb1ce21ee4b609 (patch)
tree42b795fd16dae28d88393a25f6e0c4959726c5dd /main.c
parent8ee73709d786bd0eb6aead937fcad45ad5906f91 (diff)
downloadnsxiv-8d4e3a57ab93429ca8c3e8e9b1cb1ce21ee4b609.tar.zst
Do not check file-type at startup
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/main.c b/main.c
index 95857a9..2ab8410 100644
--- a/main.c
+++ b/main.c
@@ -178,7 +178,7 @@ void update_title() {
fileidx + 1, filecnt, (int) (img.zoom * 100.0), size, unit,
filenames[fileidx]);
} else {
- n = snprintf(win_title, TITLE_LEN, "sxiv: [%d/%d] broken: %s",
+ n = snprintf(win_title, TITLE_LEN, "sxiv: [%d/%d] not an image: %s",
fileidx + 1, filecnt, filenames[fileidx]);
}
}
@@ -193,10 +193,7 @@ void update_title() {
}
int check_append(const char *filename) {
- if (!filename)
- return 0;
-
- if (img_check(filename)) {
+ if (filename && !access(filename, R_OK)) {
if (fileidx == filecnt) {
filecnt *= 2;
filenames = (const char**) s_realloc(filenames,
@@ -205,6 +202,7 @@ int check_append(const char *filename) {
filenames[fileidx++] = filename;
return 1;
} else {
+ warn("could not open file: %s", filename);
return 0;
}
}