# HG changeset patch # User Sadrul Habib Chowdhury # Date 1265226323 0 # Node ID 5f6571bb128dec9da9f43d8fc466a46fbb04a065 # Parent 36bae5f00d32f57a85669028e6b0e9c9de4efd73 Fix sending '/messages/like/this '. Fixes #10114. diff -r 36bae5f00d32 -r 5f6571bb128d pidgin/gtkconv.c --- a/pidgin/gtkconv.c Wed Feb 03 18:56:03 2010 +0000 +++ b/pidgin/gtkconv.c Wed Feb 03 19:45:23 2010 +0000 @@ -497,17 +497,15 @@ prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl); if ((prpl_info != NULL) && (prpl_info->options & OPT_PROTO_SLASH_COMMANDS_NATIVE)) { - char *firstspace; - char *slash; - - firstspace = strchr(cmdline, ' '); - if (firstspace != NULL) { - slash = strrchr(firstspace, '/'); - } else { - slash = strchr(cmdline, '/'); - } - - if (slash == NULL) { + char *spaceslash; + + /* If the first word in the entered text has a '/' in it, then the user + * probably didn't mean it as a command. So send the text as message. */ + spaceslash = cmdline; + while (*spaceslash && *spaceslash != ' ' && *spaceslash != '/') + spaceslash++; + + if (*spaceslash != '/') { purple_conversation_write(conv, "", _("Unknown command."), PURPLE_MESSAGE_NO_LOG, time(NULL)); retval = TRUE; }