aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpg-connect-agent.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gpg-connect-agent.c')
-rw-r--r--tools/gpg-connect-agent.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c
index 117f3380c..7472728c6 100644
--- a/tools/gpg-connect-agent.c
+++ b/tools/gpg-connect-agent.c
@@ -1747,7 +1747,14 @@ main (int argc, char **argv)
}
tmpline = substitute_line (tmpcond);
value = tmpline? tmpline : tmpcond;
- condition = strtol (value, NULL, 0);
+ /* "true" or "yes" are commonly used to mean TRUE;
+ all other strings will evaluate to FALSE due to
+ the strtoul. */
+ if (!ascii_strcasecmp (value, "true")
+ || !ascii_strcasecmp (value, "yes"))
+ condition = 1;
+ else
+ condition = strtol (value, NULL, 0);
xfree (tmpline);
xfree (tmpcond);