setenv: check in a more robust way that the script is being sourced
authorAntonio Ospite <ao2@ao2.it>
Tue, 6 Oct 2015 10:26:17 +0000 (12:26 +0200)
committerAntonio Ospite <ao2@ao2.it>
Tue, 6 Oct 2015 10:26:17 +0000 (12:26 +0200)
Sometimes a leading '-' shows up in $0 for login shells, for example
this happens when opening a shell with "sudo -i"; in these cases $0 will
look like "-bash" instead of "bash", and the comparison with $(basename
$SHELL) fails even if the script is being sourced.

Fix this by stripping the leading '-'.


No differences found