From 4e2bb15d32a16b11b4c61eecc2fe24d50dbe700f Mon Sep 17 00:00:00 2001 From: obarun <eric@obarun.org> Date: Fri, 25 Jan 2019 18:43:25 +1100 Subject: [PATCH] use subgetopt_r --- src/extra-tools/66-envfile.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/extra-tools/66-envfile.c b/src/extra-tools/66-envfile.c index 886df047..dc980d2e 100644 --- a/src/extra-tools/66-envfile.c +++ b/src/extra-tools/66-envfile.c @@ -30,12 +30,13 @@ #include <skalibs/djbunix.h> #include <skalibs/diuint32.h> #include <skalibs/env.h> +#include <skalibs/sgetopt.h> #include <execline/execline.h> #include <66/parser.h> -#include <stdio.h> +//#include <stdio.h> unsigned int VERBOSITY = 1 ; static stralloc senv = STRALLOC_ZERO ; @@ -161,14 +162,14 @@ int main (int argc, char const *const *argv, char const *const *envp) r = i = one = unexport = 0 ; insist = 1 ; - + PROG = "66-envfile" ; { subgetopt_t l = SUBGETOPT_ZERO ; for (;;) { - int opt = getopt_args(argc,argv, ">hf:l", &l) ; + int opt = subgetopt_r(argc,argv, ">hlf:", &l) ; if (opt == -1) break ; if (opt == -2) strerr_dief1x(110,"options must be set first") ; switch (opt) -- GitLab