diff options
| author | Karel Klic <kklic@redhat.com> | 2009-11-11 22:30:27 +0100 |
|---|---|---|
| committer | Karel Klic <kklic@redhat.com> | 2009-11-11 22:30:27 +0100 |
| commit | 07a12979cbf321c03c615f921aec601492e8d196 (patch) | |
| tree | a0eba8c5b0cf06be829c378ca8704470e37a036b /lib/Utils/xfuncs.cpp | |
| parent | 4bb5f0163c1cf3c65745ea06f1b42545ecaa35d7 (diff) | |
| parent | 640af192338643b3c9e6fbe0304726e951239c2b (diff) | |
| download | abrt-07a12979cbf321c03c615f921aec601492e8d196.tar.gz abrt-07a12979cbf321c03c615f921aec601492e8d196.tar.xz abrt-07a12979cbf321c03c615f921aec601492e8d196.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; +} |
