From 0f0bacceb4e03547755fb5e05f3d5923b81614cb Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 22 Sep 2019 17:51:27 -0700 Subject: Now $@ is *always* the selected files, even if there are none. Cleaned up the default bindings a bit to be more explicit about manipulating the cursor file vs. manipulated selected files. Added support for `ask -n` and generally confirming with a single 'y' keystroke instead of 'y' Also added a binding for `rename`-command batch renaming. --- bb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'bb.c') diff --git a/bb.c b/bb.c index 9070db5..c508db2 100644 --- a/bb.c +++ b/bb.c @@ -24,7 +24,7 @@ #include "config.h" #include "bterm.h" -#define BB_VERSION "0.15.1" +#define BB_VERSION "0.15.2" #ifndef PATH_MAX #define PATH_MAX 4096 @@ -314,15 +314,13 @@ int run_script(bb_t *bb, const char *cmd) strcat(fullcmd, cmd); args[i++] = fullcmd; args[i++] = "--"; // ensure files like "-i" are not interpreted as flags for sh - entry_t *first = bb->firstselected ? bb->firstselected : (bb->nfiles ? bb->files[bb->cursor] : NULL); - for (entry_t *e = first; e; e = e->selected.next) { + for (entry_t *e = bb->firstselected; e; e = e->selected.next) { if (i >= space) args = memcheck(realloc(args, (space += 100)*sizeof(char*))); args[i++] = e->fullname; } args[i] = NULL; - setenv("BBSELECTED", bb->firstselected ? "1" : "", 1); setenv("BBDOTFILES", bb->show_dotfiles ? "1" : "", 1); setenv("BBCURSOR", bb->nfiles ? bb->files[bb->cursor]->fullname : "", 1); setenv("BBSHELLFUNC", bbcmdfn, 1); -- cgit v1.2.3