lhunath/scripts — pull request #2 by dualbus (2013-10-03 15:51:09+00:00)
Title: Change BASH_LINENO test to (return).

The (( ! BASH_LINENO )) test fails for this particular case:

bash -c '. /path/to/bashlib; func'

because BASH_LINENO has a value of zero.

The workaround is to use 'return' in a subshell, which complains when
it is used outside a function or a non-sourced script.

Here are some tests that show that it works for the expected cases:

https://gist.github.com/dualbus/6811562