01cc1d54b4
Mark the parameter as constant since it is not modified. Remove tests for '\n' since these can never succeed. newenv can never be NULL since neither of bmake_malloc or bmake_realloc returns NULL. Improve variable names: vlist was too unexpressive. Add debug logging since unexporting variables is an uncommon operation that directly affects the observable environment of the child processes. Fix CRLF line endings in a few unit tests.
20 lines
538 B
Makefile
20 lines
538 B
Makefile
# $Id: unexport.mk,v 1.3 2020/08/08 13:00:07 rillig Exp $
|
|
|
|
# pick up a bunch of exported vars
|
|
FILTER_CMD= grep ^UT_
|
|
.include "export.mk"
|
|
|
|
.unexport UT_ZOO UT_FOO
|
|
|
|
UT_TEST = unexport
|
|
|
|
# Until 2020-08-08, Var_UnExport had special handling for '\n', that code
|
|
# was not reachable though. At that point, backslash-newline has already
|
|
# been replaced with a simple space, and variables are not yet expanded.
|
|
UT_BEFORE_NL= before
|
|
UT_AFTER_NL= after
|
|
.export UT_BEFORE_NL UT_AFTER_NL
|
|
.unexport \
|
|
UT_BEFORE_NL
|
|
.unexport ${.newline} UT_AFTER_NL
|