From 02f18cae0aa9c44beade38b1b14c9f59d54b9078 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Wed, 6 Apr 2016 13:04:44 -0700 Subject: fix setting of $argv for `source` w/no args Fixes #139 --- tests/test1.in | 8 +++++++- tests/test1.out | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test1.in b/tests/test1.in index d52d558e..ff6075cc 100644 --- a/tests/test1.in +++ b/tests/test1.in @@ -166,5 +166,11 @@ function always_fails end end -always_fails ; echo $status +# Verify $argv set correctly in sourced scripts. +# Issue #139 +echo 'echo "source argv {$argv}"' | source +echo 'echo "source argv {$argv}"' | source - +echo 'echo "source argv {$argv}"' | source - abc +echo 'echo "source argv {$argv}"' | source - abc def +always_fails ; echo $status diff --git a/tests/test1.out b/tests/test1.out index fb5ea8c8..26251a3b 100644 --- a/tests/test1.out +++ b/tests/test1.out @@ -52,4 +52,8 @@ pipe 11 pipe 12 Checking for infinite loops in no-execute before comment after comment +source argv {} +source argv {} +source argv {abc} +source argv {abc def} 1 -- cgit v1.2.3