diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2011-04-06 11:03:12 +0200 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2011-04-06 11:03:12 +0200 |
| commit | e46ab2a95aabe30fc043531fddbda16118e2888d (patch) | |
| tree | 084b940e0e8159a176e421de340b969a4c1d8c2e /src/cli/report.cpp | |
| parent | 04cc4f8c63a635bcdbce4d887e7c6b3483e6f141 (diff) | |
| parent | 2cc15eb689fa8690f652ea6db34cb2d40d0cc2cc (diff) | |
| download | abrt-e46ab2a95aabe30fc043531fddbda16118e2888d.tar.gz abrt-e46ab2a95aabe30fc043531fddbda16118e2888d.tar.xz abrt-e46ab2a95aabe30fc043531fddbda16118e2888d.zip | |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'src/cli/report.cpp')
| -rw-r--r-- | src/cli/report.cpp | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/cli/report.cpp b/src/cli/report.cpp index 172cb8f8..e2873a28 100644 --- a/src/cli/report.cpp +++ b/src/cli/report.cpp @@ -23,29 +23,6 @@ #define FIELD_SEP "%----" /* - * Trims whitespace characters both from left and right side of a string. - * Modifies the string in-place. Returns the trimmed string. - */ -static char *trim(char *str) -{ - if (!str) - return NULL; - - // Remove leading spaces. - overlapping_strcpy(str, skip_whitespace(str)); - - // Remove trailing spaces. - int i = strlen(str); - while (--i >= 0) - { - if (!isspace(str[i])) - break; - } - str[++i] = '\0'; - return str; -} - -/* * Escapes the field content string to avoid confusion with file comments. * Returned field must be free()d by caller. */ @@ -226,11 +203,11 @@ static int read_crash_report_field(const char *text, crash_data_t *report, char newvalue[length + 1]; strncpy(newvalue, textfield, length); newvalue[length] = '\0'; - trim(newvalue); + strtrim(newvalue); char oldvalue[strlen(value->content) + 1]; strcpy(oldvalue, value->content); - trim(oldvalue); + strtrim(oldvalue); // Return if no change in the contents detected. if (strcmp(newvalue, oldvalue) == 0) |
