aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoni <matzeton@googlemail.com>2015-12-09 00:05:56 +0100
committertoni <matzeton@googlemail.com>2015-12-09 00:05:56 +0100
commit70268fa85ea048fdd26aff38b83466b73048d46a (patch)
treee7d0ace362cdde7fa51fb9e6dbb29dff4ca327f2
parent1d96bc97559d4db973da8deb0154553d0077b9a4 (diff)
default option
-rw-r--r--src/opt.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opt.h b/src/opt.h
index 6d66101..a5fd37f 100644
--- a/src/opt.h
+++ b/src/opt.h
@@ -2,7 +2,7 @@
#define OPT_H 1
#define OPT(opt_index) config_opts[opt_index]
-#define GETOPT(opt_index) OPT(opt_index).opt
+#define GETOPT(opt_index) (OPT(opt_index).found != 0 ? OPT(opt_index).opt : OPT(opt_index).def)
#define OPT_USED(opt_index, uvalue) OPT(opt_index).found = uvalue;
#define d_OPT(opt_index, rvalue) OPT(opt_index).opt.dec = rvalue; OPT_USED(opt_index, 1);
#define s_OPT(opt_index, rvalue) OPT(opt_index).opt.str = rvalue; OPT_USED(opt_index, 1);