# HG changeset patch # User Christian Hammond # Date 1048313472 0 # Node ID d1c17e81055efb445af0f65e67cdd3d59b71274a # Parent 4b6bf5ed9c5e3d79220f1f6f52ba1c838138d09a [gaim-migrate @ 5179] Gather around children, and I shall tell you a tale of goblins and witches and bunnies. Yes, you heard me. Witches. You see, there once was a rooster named Fredrick some away messages AND HE WAS A MIGHTY ROOSTER with powers of they had & in them which were and one day he said, "I shall find me an adventure!" And so he set off and they were being truncated and so he grabbed a pitchfork and headed to the Dungeon of Evil where pango got upset and CRASH! committer: Tailor Script diff -r 4b6bf5ed9c5e -r d1c17e81055e src/buddy.c --- a/src/buddy.c Sat Mar 22 01:26:07 2003 +0000 +++ b/src/buddy.c Sat Mar 22 06:11:12 2003 +0000 @@ -894,11 +894,38 @@ } if(tmp) { + char *temp; + g_strdelimit(tmp, "\n", ' '); - if(strlen(tmp) > 20) + + if(strlen(tmp) > 20) { + char *c1, *c2; + statustext = g_strdup_printf("%.20s... ", tmp); + + if ((c1 = strrchr(statustext, '&')) != NULL) { + if ((c2 = strrchr(statustext, ';')) == NULL || + c2 < c1) { + + char *new_statustext; + + /* We must escape this broken entity. */ + new_statustext = g_new0(char, strlen(statustext) + 5); + + strncpy(new_statustext, statustext, c1 - statustext); + sprintf(new_statustext + (c1 - statustext), + "&%s", c1 + 1); + + g_free(statustext); + + statustext = new_statustext; + } + } + + } else statustext = g_strdup_printf("%s ", tmp); + g_free(tmp); } }