diff options
author | waker <wakeroid@gmail.com> | 2012-05-09 18:26:06 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-05-09 18:26:06 +0200 |
commit | 7dbc5fcbba40a79a314b6d9c86170b2a874e517b (patch) | |
tree | bd69173f747e908596b32d6f04fcd8581a8ea3c7 /main.c | |
parent | 03ee0a699a9e9d09d569c64baff7eec9d148e00a (diff) |
fixed starting deadbeef without full or relative path
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -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) { |