[geary/mjog/fix-ppc-test] Don't attempt to get the last initial if no other word
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/fix-ppc-test] Don't attempt to get the last initial if no other word
- Date: Sun, 15 Mar 2020 00:02:42 +0000 (UTC)
commit 819f13fb3bb961e730e199093800d5ccb24c88d6
Author: Michael Gratton <mike vee net>
Date: Sun Jul 21 10:59:30 2019 +1000
Don't attempt to get the last initial if no other word
Fixs a test failure s390, powerpc.
See #512, #724
src/client/util/util-avatar.vala | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/client/util/util-avatar.vala b/src/client/util/util-avatar.vala
index d6c0ff6b..01075160 100644
--- a/src/client/util/util-avatar.vala
+++ b/src/client/util/util-avatar.vala
@@ -89,10 +89,12 @@ namespace Util.Avatar {
// Get the first alphanumeric char of the last word of the string
index = normalized.last_index_of_char(' ');
- for (int i = 0; normalized.get_next_char(ref index, out c); i++) {
- if (c.isalnum()) {
- buf.append_unichar(c);
- break;
+ if (index >= 0) {
+ for (int i = 0; normalized.get_next_char(ref index, out c); i++) {
+ if (c.isalnum()) {
+ buf.append_unichar(c);
+ break;
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]