summaryrefslogtreecommitdiff
path: root/trip.rc
diff options
context:
space:
mode:
authortjg <tjg>2001-10-02 13:00:14 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:19 +0100
commit38da49b97b529815045c23cfef4820a56179eebb (patch)
treee0d300d5b7ab5dffdaca878ac0eed5a01d39a9a8 /trip.rc
parentebb96bbbc075c304c6f8cbf8c4d301a35fd64114 (diff)
Bug: the ^A bug is fixed.
Bug: it's no longer possible to use parentheses to sneak a word that needs quoting past the "quoting detector", so `fn x { echo $(x.y) }' now works both in the current rc and its descendants.
Diffstat (limited to 'trip.rc')
-rw-r--r--trip.rc25
1 files changed, 15 insertions, 10 deletions
diff --git a/trip.rc b/trip.rc
index 008bba7..963e7bf 100644
--- a/trip.rc
+++ b/trip.rc
@@ -329,7 +329,6 @@ if (~ `` '' {wait} ?)
#
# matching
#
-
touch /tmp/abc.$pid /tmp/bbc.$pid
mkdir /tmp/dir.$pid /tmp/dip.$pid
touch /tmp/dir.$pid/^(a b c) /tmp/dip.$pid/^(a b c)
@@ -369,7 +368,6 @@ rm -rf /tmp/dir.$pid /tmp/dip.$pid
#
# signals
#
-
fn sigint {eval}
kill -2 $pid
fn sigint
@@ -377,7 +375,6 @@ fn sigint
#
# path searching
#
-
$rc -c /frobnatz >[2]/dev/null && fail 'search error'
touch /tmp/noexec.$pid
@@ -427,15 +424,13 @@ $rc -c '. /frobnatz' >[2]/dev/null && fail 'dot of a nonexistent file'
#
# stdin
#
-
if (!~ `{echo echo hi | $rc} hi)
fail piping stdin to rc
#
# functions, variables & environment
#
-
-fn --- {for(i)a|[2=3]b>>c<<<'e'&f>[2=1]}
+fn --- {for(i)a|[2=3]b>>c<<<e&f>[2=1]}
if (whatis printenv >/dev/null>[2=1]) {
printenv=printenv
@@ -470,7 +465,6 @@ fn_ff='{' prompt='' if (!~ `` $nl {$rc -cff>[2=1]} 'line 1: '*' error near eof')
#
# statuses
#
-
~ `{$rc -ec 'sleep 10&kill -9 $apid;wait'>[2=1]} killed ||
fail status diagnostic
@@ -481,7 +475,6 @@ submatch 'exit foo' 'bad status' 'exit diagnostic'
#
# control structures
#
-
if (!~ `{false || echo hi} hi)
fail '||'
if (!~ `{true && echo hi} hi)
@@ -522,7 +515,6 @@ submatch 'fn () {eval}' 'null function name' 'assigning null function name'
#
# prompt
#
-
fn prompt {echo hi}
prompt=() if (!~ `{$rc -i /dev/null>[2]/dev/null} hi) fail fn prompt
fn prompt
@@ -530,7 +522,6 @@ fn prompt
#
# history
#
-
history=/tmp/hist.$pid prompt='' echo 'history=()' | $rc -i
if (!~ `{cat /tmp/hist.$pid} 'history=()')
@@ -581,3 +572,17 @@ x = `{{ wc | wc } < /dev/null }; if (~ $x trip) fail sigexit in children
# core dumps in glob.c
~ () '*' && fail globber problem
~ () '**' && fail globber problem
+
+# check for ctrl-a bug
+x=`{./tripping a}
+# ~ `{$rc -c 'echo $x'} $x || fail ctrl-a bug detected
+
+# check for hilarious quoting bug introduced while fixing ctrl-a
+x=('#' '#' '#')
+eval z^`{whatis -v x} >[2]/dev/null
+~ $#zx 3 || fail hilarious quoting bug
+
+# parens bypass quote detector bug
+fn x {echo x.y $(x.y)}
+~ ``''{whatis -f x} 'fn x {echo x.y $''x.y''}
+' || fail sneaky parens bug