Fix test crashing if "xdg-mime" did not exist
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 21s

This commit is contained in:
Stephen Seo 2024-10-30 14:29:03 +09:00
parent 67f59e1354
commit 8d2e5f52a4

View file

@ -979,7 +979,9 @@ int main(int argc, char **argv) {
{
FILE *fd = fopen("/usr/bin/xdg-mime", "rb");
int_fast8_t is_xdg_mime_exists = fd ? 1 : 0;
fclose(fd);
if (fd) {
fclose(fd);
}
if (is_xdg_mime_exists) {
CHECK_TRUE(c_simple_http_is_xdg_mime_available());