From ab17119d98ea15a44c50e28701b6993a0a071f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 31 Oct 2019 13:53:36 +0200 Subject: Cope with long environment variables that are wrapped over multiple lines The TERMCAP variable, if present, can be very long (27 lines and over 1500 chars in my case). In these cases, the earlier lines end with a backslash, and the following ones start with a one tab indent. Filter for lines starting with "export" to properly find the variable names only, as that's the only thing we're interested in here. --- subr/build_init.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'subr/build_init.subr') diff --git a/subr/build_init.subr b/subr/build_init.subr index 0634e33b..310585fa 100644 --- a/subr/build_init.subr +++ b/subr/build_init.subr @@ -47,7 +47,7 @@ build_init() { DEFAULT_GIT_ARGS="-6${DEFAULT_GIT_ARGS:+ ${DEFAULT_GIT_ARGS}}"; DEFAULT_WGET_ARGS="-6${DEFAULT_WGET_ARGS:+ ${DEFAULT_WGET_ARGS}}"; fi; - _env_vars="$(export | sed -e 's/^export //' -e 's/=.*$//')"; + _env_vars="$(export | grep ^export | sed -e 's/^export //' -e 's/=.*$//')"; _env_vars_except="${DEFAULT_CLEAR_ENV_VARS_EXCEPT}"; for _env_var in ${_env_vars}; do if [ "${_env_var#DEFAULT_}" != "${_env_var}" ]\ -- cgit v1.2.3