summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-12-25 02:40:19 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-12-25 02:40:19 +0000
commit8d3d7956661dcddf5e093a64d996dccff22c15c9 (patch)
tree0ff02f33d1a317fa5ee5a86d4c42e9a598ebaea6
parenta774afb87c2d021301437c3a60fdd0039cf2458b (diff)
downloadexecline-8d3d7956661dcddf5e093a64d996dccff22c15c9.tar.xz
Remove env_get
-rw-r--r--src/execline/dollarat.c7
-rw-r--r--src/libexecline/el_getstrict.c4
2 files changed, 6 insertions, 5 deletions
diff --git a/src/execline/dollarat.c b/src/execline/dollarat.c
index 04fe51c..5bc5c1f 100644
--- a/src/execline/dollarat.c
+++ b/src/execline/dollarat.c
@@ -1,6 +1,7 @@
/* ISC license. */
#include <string.h>
+#include <stdlib.h>
#include <skalibs/sgetopt.h>
#include <skalibs/buffer.h>
#include <skalibs/strerr2.h>
@@ -10,7 +11,7 @@
#define USAGE "dollarat [ -n ] [ -0 | -d delimchar ]"
-int main (int argc, char const *const *argv, char const *const *envp)
+int main (int argc, char const *const *argv)
{
unsigned int n, i = 0 ;
char const *x ;
@@ -35,14 +36,14 @@ int main (int argc, char const *const *argv, char const *const *envp)
argc -= l.ind ; argv += l.ind ;
}
if (zero) delim = 0 ;
- x = env_get2(envp, "#") ;
+ x = getenv("#") ;
if (!x) strerr_dienotset(100, "#") ;
if (!uint0_scan(x, &n)) strerr_dieinvalid(100, "#") ;
for (; i < n ; i++)
{
char fmt[UINT_FMT] ;
fmt[uint_fmt(fmt, i+1)] = 0 ;
- x = env_get2(envp, fmt) ;
+ x = getenv(fmt) ;
if (!x) strerr_dienotset(100, fmt) ;
if (delim || zero)
{
diff --git a/src/libexecline/el_getstrict.c b/src/libexecline/el_getstrict.c
index 50127be..2591193 100644
--- a/src/libexecline/el_getstrict.c
+++ b/src/libexecline/el_getstrict.c
@@ -1,6 +1,6 @@
/* ISC license. */
-#include <skalibs/env.h>
+#include <stdlib.h>
#include <skalibs/types.h>
#include <execline/execline.h>
@@ -10,7 +10,7 @@ unsigned int el_getstrict (void)
static int first = 1 ;
if (first)
{
- char const *x = env_get("EXECLINE_STRICT") ;
+ char const *x = getenv("EXECLINE_STRICT") ;
first = 0 ;
if (x) uint0_scan(x, &strict) ;
}