Imported Upstream version 0.63.0
[hcoop/debian/courier-authlib.git] / authoption.c
index e2687b5..2ed6296 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
-** Copyright 2002 Double Precision, Inc.  See COPYING for
+** Copyright 2002-2009 Double Precision, Inc.  See COPYING for
 ** distribution information.
 */
 
 ** distribution information.
 */
 
@@ -17,7 +17,7 @@
 
 #include       "auth.h"
 
 
 #include       "auth.h"
 
-static const char rcsid[]="$Id: authoption.c,v 1.3 2004/11/10 00:42:04 mrsam Exp $";
+static const char rcsid[]="$Id: authoption.c,v 1.4 2009/11/22 03:42:48 mrsam Exp $";
 
 
 int auth_getoptionenvint(const char *keyword)
 
 
 int auth_getoptionenvint(const char *keyword)
@@ -28,6 +28,9 @@ int auth_getoptionenvint(const char *keyword)
        if (!p) return 0;
 
        i = atoi(p);
        if (!p) return 0;
 
        i = atoi(p);
+
+       if (i == 0 && strchr("tTyY", *p))
+               i=1;   /* Convert 'true', 'TRUE', 'yes', 'YES' to 1 */
        free(p);
        return i;
 }
        free(p);
        return i;
 }