summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-05-09 18:26:06 +0200
committerGravatar waker <wakeroid@gmail.com>2012-05-09 18:26:06 +0200
commit7dbc5fcbba40a79a314b6d9c86170b2a874e517b (patch)
treebd69173f747e908596b32d6f04fcd8581a8ea3c7 /main.c
parent03ee0a699a9e9d09d569c64baff7eec9d148e00a (diff)
fixed starting deadbeef without full or relative path
Diffstat (limited to 'main.c')
-rw-r--r--main.c18
1 files changed, 7 insertions, 11 deletions
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) {