mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
common/file-helpers.c: share file_exists() to reduce duplication
This commit is contained in:
parent
a8951c4b75
commit
a386133068
5 changed files with 26 additions and 17 deletions
|
|
@ -8,22 +8,14 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "buffer.h"
|
||||
#include "button/button-png.h"
|
||||
#include "button/common.h"
|
||||
#include "common/file-helpers.h"
|
||||
#include "labwc.h"
|
||||
#include "theme.h"
|
||||
|
||||
/* Share with session.c:isfile() */
|
||||
static bool
|
||||
file_exists(const char *path)
|
||||
{
|
||||
struct stat st;
|
||||
return (!stat(path, &st));
|
||||
}
|
||||
|
||||
/*
|
||||
* cairo_image_surface_create_from_png() does not gracefully handle non-png
|
||||
* files, so we verify the header before trying to read the rest of the file.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue