diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-11-06 15:11:55 +0100 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-11-06 15:11:55 +0100 |
| commit | 3a62ede25114452938acb8e1a67006633b139efc (patch) | |
| tree | d3a291e5dac5d7ddf14bae4a097ff5b298b71aa5 /lib/Utils/xfuncs.cpp | |
| parent | fc571a9ac7aaa8802d3e8aacf9aefac12ca3c81c (diff) | |
| parent | 80975b02ec1a2e8dfc6f7ce21e47cf71b16b5a6e (diff) | |
| download | abrt-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.cpp | 13 |
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; +} |
