src/nnn.c | 25 ++++--------------------- diff --git a/src/nnn.c b/src/nnn.c index 272aedadeebd37a05a2f08c571227db8868db2ab..f580159ca42d65a3a05bd63eabdf353b4397b16f 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -4359,10 +4359,6 @@ 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 @@ if (!initpath) { 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 */ @@ -4443,6 +4422,10 @@ xerror(); return 1; } #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]));