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