summaryrefslogtreecommitdiffstats
path: root/src/cli
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2011-04-04 12:02:27 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2011-04-04 12:02:27 +0200
commit90fe3a9d0cd766d18d1142d8d6981193a5715643 (patch)
tree7df1a3ef2b4fd08f706345a05b78526d5837eac2 /src/cli
parent2ee0754ffb52a8bb65cb718189536b715e56f8d3 (diff)
downloadabrt-90fe3a9d0cd766d18d1142d8d6981193a5715643.tar.gz
abrt-90fe3a9d0cd766d18d1142d8d6981193a5715643.tar.xz
abrt-90fe3a9d0cd766d18d1142d8d6981193a5715643.zip
rhbz#692465 - Blacklist doesn't work
parse_value() doesn't trim the string. Lest say BlackList = coreutils, mono the parsed list looks like -> 'coreutils', ' mono' Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'src/cli')
-rw-r--r--src/cli/report.cpp27
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)