Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
--- /dev/null
+0:arg0 1:arg1 2:arg2
+Ok1:0
+0:arg0 1:q 2:w
+Ok2:0
--- /dev/null
+echo 'echo "0:$0 1:$1 2:$2"' >sourced1
+set -- 1 2 3
+"$THIS_SH" -c '. ./sourced1' arg0 arg1 arg2
+echo Ok1:$?
+"$THIS_SH" -c '. ./sourced1 q w e' arg0 arg1 arg2
+echo Ok2:$?
+
+rm sourced1
-hush: syntax error: unterminated ${name}
-line2
-Ok1:0
-hush: syntax error: unterminated '
-Ok2:1
+Sourced ok
+Done
-echo 'echo ${^}
-echo line2' >sourced1
-. ./sourced1
-echo Ok1:$?
-
-echo "echo '" >sourced1
-. ./sourced1
-echo Ok2:$?
-
-rm sourced1
+echo "echo Sourced ok" >../sourced.sh
+PATH="..:$PATH"
+. sourced.sh
+rm ../sourced.sh
+echo Done
-0:arg0 1:arg1 2:arg2
-Ok1:0
-0:arg0 1:q 2:w
-Ok2:0
+Done: 0
-echo 'echo "0:$0 1:$1 2:$2"' >sourced1
-set -- 1 2 3
-"$THIS_SH" -c '. ./sourced1' arg0 arg1 arg2
-echo Ok1:$?
-"$THIS_SH" -c '. ./sourced1 q w e' arg0 arg1 arg2
-echo Ok2:$?
-
-rm sourced1
+false
+. /dev/null
+echo Done: $?
--- /dev/null
+hush: syntax error: unterminated ${name}
+line2
+Ok1:0
+hush: syntax error: unterminated '
+Ok2:1
--- /dev/null
+echo 'echo ${^}
+echo line2' >sourced1
+. ./sourced1
+echo Ok1:$?
+
+echo "echo '" >sourced1
+. ./sourced1
+echo Ok2:$?
+
+rm sourced1
--- /dev/null
+0:arg0 1:arg1 2:arg2
+Ok1:0
+0:arg0 1:q 2:w
+Ok2:0
--- /dev/null
+echo 'echo "0:$0 1:$1 2:$2"' >sourced1
+set -- 1 2 3
+"$THIS_SH" -c '. ./sourced1' arg0 arg1 arg2
+echo Ok1:$?
+"$THIS_SH" -c '. ./sourced1 q w e' arg0 arg1 arg2
+echo Ok2:$?
+
+rm sourced1