summaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko2021-09-07 18:01:49 +0200
committerDenys Vlasenko2021-09-07 18:01:49 +0200
commitd6c9cbc0727cc3875672ae280ec129514a9d8594 (patch)
treed402b52d331c23cf41b43e628b3ac59e742a7ff0 /shell/hush_test
parent0d7dfa9012d01159c371bf041bf53afe0780df9f (diff)
downloadbusybox-d6c9cbc0727cc3875672ae280ec129514a9d8594.zip
busybox-d6c9cbc0727cc3875672ae280ec129514a9d8594.tar.gz
ash: fix LINENO in functions
From larger patch by Roberto A. Foglietta <roberto.foglietta@gmail.com> function old new delta evalfun 348 369 +21 ash_main 1202 1218 +16 setinputstring 65 73 +8 lookupvar 116 106 -10 evaltree 772 753 -19 evalsubshell 192 173 -19 evalfor 175 156 -19 evalcase 273 254 -19 evalcommand 1560 1536 -24 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/6 up/down: 45/-110) Total: -65 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-vars/var_LINENO2.right3
-rwxr-xr-xshell/hush_test/hush-vars/var_LINENO2.tests8
2 files changed, 11 insertions, 0 deletions
diff --git a/shell/hush_test/hush-vars/var_LINENO2.right b/shell/hush_test/hush-vars/var_LINENO2.right
new file mode 100644
index 0000000..7365664
--- /dev/null
+++ b/shell/hush_test/hush-vars/var_LINENO2.right
@@ -0,0 +1,3 @@
+Start LINENO=6, calling function
+In function: LINENO=4
+After function: LINENO=8
diff --git a/shell/hush_test/hush-vars/var_LINENO2.tests b/shell/hush_test/hush-vars/var_LINENO2.tests
new file mode 100755
index 0000000..7036dbd
--- /dev/null
+++ b/shell/hush_test/hush-vars/var_LINENO2.tests
@@ -0,0 +1,8 @@
+#skip lines: make "line number within function" differ from overall line number
+#skip lines
+f() {
+ echo "In function: LINENO=$LINENO"
+}
+echo "Start LINENO=$LINENO, calling function"
+f
+echo "After function: LINENO=$LINENO"