diff options
| author | Jiri Moskovcak <jmoskovc@localhost.localdomain> | 2009-11-18 15:51:49 +0100 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@localhost.localdomain> | 2009-11-18 15:51:49 +0100 |
| commit | b6a34a21048ca7edfa913e8c5ee094f4cb85503f (patch) | |
| tree | d1b768d95fbbf2904edd8ac4fb8f6e977841d5c9 /lib/Utils | |
| parent | dfcf49e5a3d80fcf61bd4dbac4f8d95d45996278 (diff) | |
| parent | 344a3dcc7a22e0e5dd74fe0bfb0483220c3dc7ad (diff) | |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib/Utils')
| -rw-r--r-- | lib/Utils/CommLayerInner.cpp | 2 | ||||
| -rw-r--r-- | lib/Utils/make_descr.cpp | 2 | ||||
| -rw-r--r-- | lib/Utils/stringops.cpp | 25 |
3 files changed, 19 insertions, 10 deletions
diff --git a/lib/Utils/CommLayerInner.cpp b/lib/Utils/CommLayerInner.cpp index 307fe66d..133e97d2 100644 --- a/lib/Utils/CommLayerInner.cpp +++ b/lib/Utils/CommLayerInner.cpp @@ -72,7 +72,7 @@ void update_client(const char *fmt, ...) int used = vasprintf(&msg, fmt, p); va_end(p); if (used < 0) - return; + return; s_pObs->Status(msg, peer, key); } diff --git a/lib/Utils/make_descr.cpp b/lib/Utils/make_descr.cpp index 1352149e..0c096143 100644 --- a/lib/Utils/make_descr.cpp +++ b/lib/Utils/make_descr.cpp @@ -75,7 +75,7 @@ string make_description_bz(const map_crash_report_t& pCrashReport) && filename != FILENAME_RELEASE && filename != CD_REPRODUCE && filename != CD_COMMENT - ) { + ) { add_content(was_multiline, description, filename.c_str(), content.c_str()); } } diff --git a/lib/Utils/stringops.cpp b/lib/Utils/stringops.cpp index 1b3793fc..dc71b5bd 100644 --- a/lib/Utils/stringops.cpp +++ b/lib/Utils/stringops.cpp @@ -3,24 +3,33 @@ void parse_args(const char *psArgs, vector_string_t& pArgs, int quote) { unsigned ii; - bool is_quote = false; + bool inside_quotes = false; std::string item; for (ii = 0; psArgs[ii]; ii++) { - if (quote != -1 && psArgs[ii] == quote) + if (quote != -1) { - is_quote = !is_quote; + if (psArgs[ii] == quote) + { + inside_quotes = !inside_quotes; + continue; + } + /* inside quotes we support escaping with \x */ + if (inside_quotes && psArgs[ii] == '\\' && psArgs[ii+1]) + { + ii++; + item += psArgs[ii]; + continue; + } } - else if (psArgs[ii] == ',' && !is_quote) + if (psArgs[ii] == ',' && !inside_quotes) { pArgs.push_back(item); item.clear(); + continue; } - else - { - item += psArgs[ii]; - } + item += psArgs[ii]; } if (item.size() != 0) |
