[evolution] Bug 770369 - Strip trailing white-spaces in Remove duplicate messages
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug 770369 - Strip trailing white-spaces in Remove duplicate messages
- Date: Thu, 25 Aug 2016 19:03:09 +0000 (UTC)
commit 6e80a7e097ed5d3164d19b2088ae75c74a5a656d
Author: Milan Crha <mcrha redhat com>
Date: Thu Aug 25 21:01:20 2016 +0200
Bug 770369 - Strip trailing white-spaces in Remove duplicate messages
libemail-engine/e-mail-folder-utils.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/libemail-engine/e-mail-folder-utils.c b/libemail-engine/e-mail-folder-utils.c
index edfa9ea..0bb12bf 100644
--- a/libemail-engine/e-mail-folder-utils.c
+++ b/libemail-engine/e-mail-folder-utils.c
@@ -725,13 +725,21 @@ emfu_get_messages_hash_sync (CamelFolder *folder,
content, stream, cancellable, error);
if (n_bytes >= 0) {
+ guint data_len;
+
/* The CamelStreamMem owns the buffer. */
buffer = camel_stream_mem_get_byte_array (
CAMEL_STREAM_MEM (stream));
g_return_val_if_fail (buffer != NULL, NULL);
- digest = g_compute_checksum_for_data (
- G_CHECKSUM_SHA256, buffer->data, buffer->len);
+ data_len = buffer->len;
+
+ /* Strip trailing white-spaces and empty lines */
+ while (data_len > 0 && g_ascii_isspace (buffer->data[data_len - 1]))
+ data_len--;
+
+ if (data_len > 0)
+ digest = g_compute_checksum_for_data (G_CHECKSUM_SHA256,
buffer->data, data_len);
}
g_object_unref (stream);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]