check if file exists and default to character representation if it doesn't

This commit is contained in:
Bram Wasti 2015-01-06 22:07:06 -05:00
parent 510cc745cf
commit b38dd088f5
1 changed files with 5 additions and 0 deletions

5
bar.c
View File

@ -281,6 +281,11 @@ bool get_image_file(char *str, char *optend, char **end)
img_file = p;
*end = trail + 1;
/* Check if the image exists. */
if (access(img_file, F_OK) == -1) {
return false;
}
return true;
}