mirror of
https://github.com/jarun/nnn.git
synced 2024-09-28 16:57:50 +00:00
Improve readibility
This commit is contained in:
parent
8ac4a834ad
commit
29a934a1d2
|
@ -3889,8 +3889,7 @@ nochange:
|
||||||
/* If NNN_USE_EDITOR is set, open text in EDITOR */
|
/* If NNN_USE_EDITOR is set, open text in EDITOR */
|
||||||
if (cfg.useeditor &&
|
if (cfg.useeditor &&
|
||||||
get_output(g_buf, CMD_LEN_MAX, "file", FILE_OPTS, newpath, FALSE)
|
get_output(g_buf, CMD_LEN_MAX, "file", FILE_OPTS, newpath, FALSE)
|
||||||
&& g_buf[0] == 't' && g_buf[1] == 'e' && g_buf[2] == 'x'
|
&& !strncmp(g_buf, "text/", 5)) {
|
||||||
&& g_buf[3] == g_buf[0] && g_buf[4] == '/') {
|
|
||||||
spawn(editor, newpath, NULL, path, F_CLI);
|
spawn(editor, newpath, NULL, path, F_CLI);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -5168,8 +5167,7 @@ int main(int argc, char *argv[])
|
||||||
initpath = "/";
|
initpath = "/";
|
||||||
} else {
|
} else {
|
||||||
arg = argv[optind];
|
arg = argv[optind];
|
||||||
if (strlen(arg) > 7 && arg[0] == 'f' && arg[1] == 'i' && arg[2] == 'l'
|
if (strlen(arg) > 7 && !strncmp(arg, "file://", 7))
|
||||||
&& arg[3] == 'e' && arg[4] == ':' && arg[5] == '/' && arg[6] == '/')
|
|
||||||
arg = arg + 7;
|
arg = arg + 7;
|
||||||
initpath = realpath(arg, NULL);
|
initpath = realpath(arg, NULL);
|
||||||
DPRINTF_S(initpath);
|
DPRINTF_S(initpath);
|
||||||
|
|
Loading…
Reference in a new issue