summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2017-11-18 12:35:33 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2017-11-18 12:35:33 +0100
commit31b2445000b7f5f88e363f85de1e70e91c2adbaf (patch)
tree96baade155d94fd60c6c23e50e44c720ccb0c8a4
parent0fedff44e3cf7d1f1edfb15f160320dcc6746bd8 (diff)
downloadii-master.zip
ii-master.tar.gz
ii-master.tar.bz2
don't modify argv, use a counterHEADmaster
on some platforms (OpenBSD) this changes the exposed argv in tools using the kvm_* interface, such as ps and pgrep.
-rw-r--r--arg.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/arg.h b/arg.h
index e94e02b..fe4d7e5 100644
--- a/arg.h
+++ b/arg.h
@@ -21,12 +21,13 @@ extern char *argv0;
argc--;\
break;\
}\
- for (brk_ = 0, argv[0]++, argv_ = argv;\
- argv[0][0] && !brk_;\
- argv[0]++) {\
+ int i_;\
+ for (i_ = 1, brk_ = 0, argv_ = argv;\
+ argv[0][i_] && !brk_;\
+ i_++) {\
if (argv_ != argv)\
break;\
- argc_ = argv[0][0];\
+ argc_ = argv[0][i_];\
switch (argc_)
#define ARGEND }\