aboutsummaryrefslogtreecommitdiff
path: root/bb.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-10-02 01:40:40 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-10-02 01:40:40 -0700
commitc7e08b884ab876c8ce06000a8789045b50d40c20 (patch)
tree2926457f083304b17abef20105486ba97bf8bb4b /bb.h
parent7f402ee32afa7ed065c26d83fbe4537cfeae98f8 (diff)
Fix for some messed up behavior for Escape key and for passing vararg
commands to bb
Diffstat (limited to 'bb.h')
-rw-r--r--bb.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/bb.h b/bb.h
index bdbc0c1..9e18345 100644
--- a/bb.h
+++ b/bb.h
@@ -225,13 +225,13 @@ static const char *bbcmdfn = "bb() {\n"
" if test $# -eq 0; then cat >> $BBCMD; return; fi\n"
" for arg; do\n"
" shift;\n"
-" if echo \"$arg\" | grep \"^+[^:]*:$\" >/dev/null 2>/dev/null; then\n"
-" if test $# -gt 0; then printf \"%s\\0\" \"$arg\" \"$@\" >> $BBCMD\n"
-" else sed \"s/\\([^\\x00]\\+\\)/$arg\\1/g\" >> $BBCMD; fi\n"
-" return\n"
-" fi\n"
-" printf \"%s\\0\" \"$arg\" >> $BBCMD\n"
-" done\n"
+" if expr \"$arg\" : \"^+[^:]*:$\" >/dev/null; then\n"
+" if test $# -gt 0; then printf \"$arg%s\\0\" \"$@\" >> $BBCMD;\n"
+" else sed \"s/\\([^\\x00]\\+\\)/$arg\\1/g\" >> $BBCMD; fi;\n"
+" return;\n"
+" fi;\n"
+" printf \"%s\\0\" \"$arg\" >> $BBCMD;\n"
+" done;\n"
"}\n"
"ask() {\n"
#ifdef ASK