| Date: Wed, 9 Aug 2017 20:06:22 +0200
don't modify argv, use a counter
on some platforms (OpenBSD) this changes the exposed argv in tools
using the kvm_* interface, such as ps and pgrep.
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat:
arg.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- |
| t@@ -16,11 +16,12 @@ extern char *argv0;
argc--;\
break;\
}\
- for(argv[0]++, _argv = argv; argv[0][0];\
- argv[0]++) {\
+ int i_;\
+ for(i_ = 1, _argv = argv; argv[0][i_];\
+ i_++) {\
if(_argv != argv)\
break;\
- _argc = argv[0][0];\
+ _argc = argv[0][i_];\
switch(_argc)
#define ARGEND }\ |