# HG changeset patch # User John Bailey # Date 1228002830 0 # Node ID 6b9552b09de0db663d25db1999ba19cab359d3cd # Parent cff5d920b87f9cb37a26caf1843aad795495b428 Avoid needlessly calling gethostname() if __HOSTNAME__ doesn't appear in the resource string. diff -r cff5d920b87f -r 6b9552b09de0 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Sat Nov 29 23:35:12 2008 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sat Nov 29 23:53:50 2008 +0000 @@ -153,6 +153,9 @@ if (*input == '\0') return NULL; + if (strstr(input, "__HOSTNAME__") == NULL) + return input; + /* Replace __HOSTNAME__ with hostname */ if (gethostname(hostname, sizeof(hostname) - 1)) { purple_debug_warning("jabber", "gethostname: %s\n", g_strerror(errno));