From 7dbc5fcbba40a79a314b6d9c86170b2a874e517b Mon Sep 17 00:00:00 2001 From: waker Date: Wed, 9 May 2012 18:26:06 +0200 Subject: fixed starting deadbeef without full or relative path --- main.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 2f01d1ee..ab8c59a0 100644 --- a/main.c +++ b/main.c @@ -697,17 +697,13 @@ main (int argc, char *argv[]) { char *e = strrchr (dbinstalldir, '/'); if (e) { *e = 0; - } - else { - fprintf (stderr, "couldn't determine install folder from path %s\n", argv[0]); - exit (-1); - } - struct stat st; - char checkpath[PATH_MAX]; - snprintf (checkpath, sizeof (checkpath), "%s/.ddb_portable", dbinstalldir); - if (!stat (checkpath, &st)) { - if (S_ISREG (st.st_mode)) { - portable = 1; + struct stat st; + char checkpath[PATH_MAX]; + snprintf (checkpath, sizeof (checkpath), "%s/.ddb_portable", dbinstalldir); + if (!stat (checkpath, &st)) { + if (S_ISREG (st.st_mode)) { + portable = 1; + } } } if (!portable) { -- cgit v1.2.3