diff options
Diffstat (limited to 'src/slideshow.c')
-rw-r--r-- | src/slideshow.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/slideshow.c b/src/slideshow.c index e6ffb56..52ef4b3 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -402,41 +402,31 @@ char *feh_printf(char *str, feh_file * file) strcat(ret, file->name); break; case 'w': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { snprintf(buf, sizeof(buf), "%d", file->info->width); strcat(ret, buf); } break; case 'h': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { snprintf(buf, sizeof(buf), "%d", file->info->height); strcat(ret, buf); } break; case 's': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { snprintf(buf, sizeof(buf), "%d", file->info->size); strcat(ret, buf); } break; case 'p': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { snprintf(buf, sizeof(buf), "%d", file->info->pixels); strcat(ret, buf); } break; case 't': - if (file) { - if (!file->info) - feh_file_info_load(file, NULL); + if (file && (file->info || !feh_file_info_load(file, NULL))) { strcat(ret, file->info->format); } break; |