summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-10-12 01:10:57 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-10-12 01:10:57 +0000
commitf3481b43bd892cde7b32af19a92393008257013e (patch)
tree136ddbdd52662c24a82d3ff882ef10599bf40e21
parentf19e58049045ab6395d746d4280404a6595e613a (diff)
downloadexecline-f3481b43bd892cde7b32af19a92393008257013e.tar.xz
Make execlineb itself honor EXECLINE_STRICT
-rw-r--r--src/execline/execlineb.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/execline/execlineb.c b/src/execline/execlineb.c
index e93c3e9..7397be5 100644
--- a/src/execline/execlineb.c
+++ b/src/execline/execlineb.c
@@ -1,6 +1,8 @@
/* ISC license. */
#include <string.h>
+#include <stdlib.h>
+
#include <skalibs/types.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/sgetopt.h>
@@ -132,6 +134,20 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (!env_addmodif(&modif, "EXECLINE_STRICT", flagstrict ? fmt : 0))
goto errenv ;
}
+ else
+ {
+ char const *x = getenv("EXECLINE_STRICT") ;
+ if (x)
+ {
+ unsigned int u ;
+ if (!uint0_scan(x, &u))
+ {
+ strerr_warnw1x("invalid EXECLINE_STRICT value, unsetting it") ;
+ if (!env_addmodif(&modif, "EXECLINE_STRICT", 0)) goto errenv ;
+ }
+ else flagstrict = u ;
+ }
+ }
if (flagpushenv == 3 || flagpushenv == 4)
{