aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar Barrucadu <mike@barrucadu.co.uk>2009-04-26 19:31:41 +0100
committerGravatar Barrucadu <mike@barrucadu.co.uk>2009-04-26 19:31:41 +0100
commite821515a4d95f39d72e9a298fb920a228300d90b (patch)
tree489102198b288fdb35eb51694278e8a4e3a68921 /uzbl.c
parent980afc2a913058099720ec56924249f4da52e2f3 (diff)
Added file_exists function (will be used to check for config file).
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c10
1 files changed, 10 insertions, 0 deletions
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) {