aboutsummaryrefslogtreecommitdiff
path: root/bb.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-09-22 17:51:27 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-09-22 17:51:27 -0700
commit0f0bacceb4e03547755fb5e05f3d5923b81614cb (patch)
treef71dd9e12b128bffcf59877823f2dc951e7d8e3c /bb.c
parentef577177747fd0a4778b92f762e0964d0ba3aafc (diff)
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<enter>' Also added a binding for `rename`-command batch renaming.
Diffstat (limited to 'bb.c')
-rw-r--r--bb.c6
1 files changed, 2 insertions, 4 deletions
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);