summaryrefslogtreecommitdiffstats
path: root/lib/Utils/xfuncs.cpp
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-11-06 15:11:55 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2009-11-06 15:11:55 +0100
commit3a62ede25114452938acb8e1a67006633b139efc (patch)
treed3a291e5dac5d7ddf14bae4a097ff5b298b71aa5 /lib/Utils/xfuncs.cpp
parentfc571a9ac7aaa8802d3e8aacf9aefac12ca3c81c (diff)
parent80975b02ec1a2e8dfc6f7ce21e47cf71b16b5a6e (diff)
downloadabrt-3a62ede25114452938acb8e1a67006633b139efc.tar.gz
abrt-3a62ede25114452938acb8e1a67006633b139efc.tar.xz
abrt-3a62ede25114452938acb8e1a67006633b139efc.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib/Utils/xfuncs.cpp')
-rw-r--r--lib/Utils/xfuncs.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Utils/xfuncs.cpp b/lib/Utils/xfuncs.cpp
index 533fbfa..97c2f76 100644
--- a/lib/Utils/xfuncs.cpp
+++ b/lib/Utils/xfuncs.cpp
@@ -355,3 +355,16 @@ std::string concat_path_file(const char *path, const char *filename)
lc = last_char_is(path, '/');
return ssprintf("%s%s%s", path, (lc==NULL ? "/" : ""), filename);
}
+
+bool string_to_bool(const char *s)
+{
+ if (s[0] == '1' && s[1] == '\0')
+ return true;
+ if (strcasecmp(s, "on") == 0)
+ return true;
+ if (strcasecmp(s, "yes") == 0)
+ return true;
+ if (strcasecmp(s, "true") == 0)
+ return true;
+ return false;
+}