]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix future namespace issues for functions taking $var_to_set -- functions
authordteske <dteske@FreeBSD.org>
Fri, 14 Mar 2014 02:50:32 +0000 (02:50 +0000)
committerdteske <dteske@FreeBSD.org>
Fri, 14 Mar 2014 02:50:32 +0000 (02:50 +0000)
commitea3e323b42476c1e55c5031a1d4b9d9da5413224
treea7f24f9061c41212a315bd5c3b8f039678557d2a
parent0e1eb3b2f374dce39c7400e535794d395ed04a9b
Fix future namespace issues for functions taking $var_to_set -- functions
taking a variable to set need to make sure they protect their locals; if
$var_to_set positional argument coincides with a local the expected call
to `setvar' will fail to reach outside of the function's namespace. When
such collisions are experienced (as I did in the rewrite of usermgmt) the
solution is to append a full or abbreviated version of the function name
to the local (ultimately eliminating collisions). This is rarely needed
and only occurs when you have a lot of like-named functions that pass
very similar $var_to_set positional arguments to each other (such as-is
the case with an expansive library such as `dialog.subr').
usr.sbin/bsdconfig/share/dialog.subr