From e821515a4d95f39d72e9a298fb920a228300d90b Mon Sep 17 00:00:00 2001 From: Barrucadu Date: Sun, 26 Apr 2009 19:31:41 +0100 Subject: Added file_exists function (will be used to check for config file). --- uzbl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'uzbl.c') diff --git a/uzbl.c b/uzbl.c index 63c4879..9471c70 100644 --- a/uzbl.c +++ b/uzbl.c @@ -179,6 +179,16 @@ static Command commands[] = /* -- CORE FUNCTIONS -- */ +static bool +file_exists (const char * filename) +{ + if (FILE * file = fopen (filename, "r")) { + fclose (file); + return true; + } + return false; +} + // make sure to put '' around args, so that if there is whitespace we can still keep arguments together. static gboolean run_command(const char *command, const char *args) { -- cgit v1.2.3