locate(1): Bring in some updates/fixes from FreeBSD
[dragonfly.git] / contrib / mdocml / test-getsubopt.c
blob2da982380aef1bfd8c56395d7db5cb5f6acd42f9
1 #if defined(__linux__) || defined(__MINT__)
2 # define _GNU_SOURCE /* getsubopt() */
3 #endif
5 #include <stdlib.h>
7 extern char *suboptarg;
9 int
10 main(void)
12 char buf[] = "k=v";
13 char *options = buf;
14 char token0[] = "k";
15 char *const tokens[] = { token0, NULL };
16 char *value = NULL;
17 return( ! (0 == getsubopt(&options, tokens, &value)
18 && suboptarg == buf && value == buf+2 && options == buf+3));