return TRUE;
}
+static bool plugscript(const char *plugin, uchar_t flags)
+{
+ mkpath(plgpath, plugin, g_buf);
+ if (!access(g_buf, X_OK)) {
+ spawn(g_buf, NULL, NULL, NULL, flags);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void opstr(char *buf, char *op)
{
snprintf(buf, CMD_LEN_MAX, "xargs -0 sh -c '%s \"$0\" \"$@\" . < /dev/tty' < %s",
}
/* Returns TRUE if file is removed, else FALSE */
-static bool xrm(char *fpath)
+static bool xrm(char * const fpath)
{
char r = confirm_force(FALSE);
if (!r)
return (access(fpath, F_OK) == -1); /* File is removed */
}
+static void xrmfromsel(char *path, char *fpath)
+{
+ bool selected = TRUE;
+
+ if ((pdents[cur].flags & DIR_OR_DIRLNK) && scanselforpath(fpath, FALSE))
+ clearselection();
+ else if (pdents[cur].flags & FILE_SELECTED) {
+ --nselected;
+ rmfromselbuf(mkpath(path, pdents[cur].name, g_buf));
+ } else
+ selected = FALSE;
+
+#ifndef NOX11
+ if (selected && cfg.x11)
+ plugscript(utils[UTIL_CBCP], F_NOWAIT | F_NOTRACE);
+#endif
+}
+
static uint_t lines_in_file(int fd, char *buf, size_t buflen)
{
ssize_t len;
return TRUE;
}
-static bool plugscript(const char *plugin, uchar_t flags)
-{
- mkpath(plgpath, plugin, g_buf);
- if (!access(g_buf, X_OK)) {
- spawn(g_buf, NULL, NULL, NULL, flags);
- return TRUE;
- }
-
- return FALSE;
-}
-
static bool launch_app(char *newpath)
{
int r = F_NORMAL;
if (!xrm(newpath))
continue;
+ xrmfromsel(tmp, newpath);
+
copynextname(lastname);
if (cfg.filtermode || filterset())