summaryrefslogtreecommitdiff
path: root/src/bsd_getopt.c
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2011-05-25 07:38:36 +0200
committerGuillem Jover <guillem@hadrons.org>2011-05-28 10:31:06 +0200
commit9d042171749b94510b071c9e800ed0d2a4e95bb9 (patch)
treef516a52f057ee04a7660d5816fde8572a03f0b51 /src/bsd_getopt.c
parent17a9a8472ec3f9a40ab2fcf2e21f1fa9468e0288 (diff)
downloadlibbsd-9d042171749b94510b071c9e800ed0d2a4e95bb9.tar.gz
Map getopt to bsd_getopt if we are using the overlay
This will ensure the code can safely and correctly use optreset transparently.
Diffstat (limited to 'src/bsd_getopt.c')
-rw-r--r--src/bsd_getopt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bsd_getopt.c b/src/bsd_getopt.c
index f5fb304..3e89817 100644
--- a/src/bsd_getopt.c
+++ b/src/bsd_getopt.c
@@ -36,5 +36,9 @@ bsd_getopt(int argc, char **argv, char *shortopts)
optind = 0;
}
- return getopt(argc, argv, shortopts);
+ /*
+ * Make sure we are using the system getopt() and not a possible
+ * overlay macro.
+ */
+ return (getopt)(argc, argv, shortopts);
}