mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Co-authored-by: Todd Yamakawa <todd.yamakawa@arm.com>
This commit is contained in:
parent
58ecc240ed
commit
c63fb28eff
25
src/nnn.c
25
src/nnn.c
|
@ -4187,25 +4187,28 @@ static bool run_selected_plugin(char **path, const char *file, char *runfile, ch
|
||||||
g_states |= STATE_PLUGIN_INIT;
|
g_states |= STATE_PLUGIN_INIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*file == '_')
|
|
||||||
return run_cmd_as_plugin(*path, file, runfile);
|
|
||||||
|
|
||||||
fd = open(g_pipepath, O_RDONLY | O_NONBLOCK);
|
fd = open(g_pipepath, O_RDONLY | O_NONBLOCK);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Generate absolute path to plugin */
|
/* Run plugin from command */
|
||||||
mkpath(plugindir, file, g_buf);
|
if (*file == '_')
|
||||||
|
run_cmd_as_plugin(*path, file, runfile);
|
||||||
|
|
||||||
if (runfile && runfile[0]) {
|
/* Run command from plugin */
|
||||||
xstrsncpy(*lastname, runfile, NAME_MAX);
|
else {
|
||||||
spawn(g_buf, *lastname, *path, *path, F_NORMAL);
|
/* Generate absolute path to plugin */
|
||||||
} else
|
mkpath(plugindir, file, g_buf);
|
||||||
spawn(g_buf, NULL, *path, *path, F_NORMAL);
|
|
||||||
|
if (runfile && runfile[0]) {
|
||||||
|
xstrsncpy(*lastname, runfile, NAME_MAX);
|
||||||
|
spawn(g_buf, *lastname, *path, *path, F_NORMAL);
|
||||||
|
} else
|
||||||
|
spawn(g_buf, NULL, *path, *path, F_NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
len = read(fd, g_buf, PATH_MAX);
|
len = read(fd, g_buf, PATH_MAX);
|
||||||
g_buf[len] = '\0';
|
g_buf[len] = '\0';
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
if (len > 1) {
|
if (len > 1) {
|
||||||
|
|
Loading…
Reference in a new issue