2 ** Copyright 2002 Double Precision, Inc. See COPYING for
3 ** distribution information.
7 #include "courier_auth_config.h"
20 static const char rcsid
[]="$Id: authoption.c,v 1.3 2004/11/10 00:42:04 mrsam Exp $";
23 int auth_getoptionenvint(const char *keyword
)
25 char *p
= auth_getoptionenv(keyword
);
35 char *auth_getoptionenv(const char *keyword
)
37 return auth_getoption(getenv("OPTIONS"), keyword
);
40 char *auth_getoption(const char *options
, const char *keyword
)
42 size_t keyword_l
=strlen(keyword
);
47 if (strncmp(options
, keyword
, keyword_l
) == 0)
49 if (options
[keyword_l
] == 0 ||
50 options
[keyword_l
] == ',')
53 if (options
[keyword_l
] == '=')
60 options
[keyword_l
] != ',';
64 if (!(p
=malloc(keyword_l
+1)))
66 memcpy(p
, options
, keyword_l
);
72 options
=strchr(options
, ',');