aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-05-08 23:17:35 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-05-22 08:44:19 +0530
commitb093d98a6e778aab99a52447bd7a011e14cc7d25 (patch)
tree275f56301a7f867e8f74d5c8859fe38058cacb55 /src
parent3e54217ae91cb97c85540be649c7cd2aff2ceb69 (diff)
downloadnnn-b093d98a6e778aab99a52447bd7a011e14cc7d25.tar.gz
Fix regression with opening binary file
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 272aeda..f580159 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4359,10 +4359,6 @@ int main(int argc, char *argv[])
if (!setup_config())
return 1;
- /* Get custom opener, if set */
- opener = xgetenv(env_cfg[NNN_OPENER], utils[OPENER]);
- DPRINTF_S(opener);
-
/* Parse bookmarks string */
if (!parsebmstr()) {
fprintf(stderr, "%s\n", env_cfg[NNN_BMS]);
@@ -4390,23 +4386,6 @@ int main(int argc, char *argv[])
xerror();
return 1;
}
-
- /*
- * If nnn is set as the file manager, applications may try to open
- * files by invoking nnn. In that case pass the file path to the
- * desktop opener and exit.
- */
- struct stat sb;
-
- if (stat(initpath, &sb) == -1) {
- xerror();
- return 1;
- }
-
- if (S_ISREG(sb.st_mode)) {
- spawn(opener, initpath, NULL, NULL, F_NOTRACE | F_NOWAIT);
- return 0;
- }
}
/* Edit text in EDITOR, if opted */
@@ -4444,6 +4423,10 @@ int main(int argc, char *argv[])
}
#endif
+ /* Get custom opener, if set */
+ opener = xgetenv(env_cfg[NNN_OPENER], utils[OPENER]);
+ DPRINTF_S(opener);
+
/* Set nnn nesting level, idletimeout used as tmp var */
idletimeout = xatoi(getenv(env_cfg[NNNLVL]));
setenv(env_cfg[NNNLVL], xitoa(++idletimeout), 1);