Introduction
Introduction Statistics Contact Development Disclaimer Help
don't modify argv, use a counter - geomyidae - A small C-based gopherd.
git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfri…
Log
Files
Refs
Tags
README
LICENSE
---
commit 43c38bfe30bbab0d8be207859f773e49d283053a
parent 8c3240e00e39e5a56605b97553b0a14ad0eae2dd
Author: Hiltjo Posthuma <[email protected]>
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 <[email protected]>
Diffstat:
M arg.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/arg.h b/arg.h
@@ -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 }\
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.