# HG changeset patch # User Mikael Berthe # Date 1161422535 -7200 # Node ID ea939ff047d8cd44d7747d4180f2374b1fe2ecdd # Parent a58dfdd6d0584cbc6e3b0e850a2a8d2deea602b5 Improve /buffer search_* Quotes can be used in search strings, for example one can search for " is " now (with spaces around the word). diff -r a58dfdd6d058 -r ea939ff047d8 mcabber/src/commands.c --- a/mcabber/src/commands.c Sat Oct 21 11:07:50 2006 +0200 +++ b/mcabber/src/commands.c Sat Oct 21 11:22:15 2006 +0200 @@ -518,7 +518,8 @@ } else if (!strcasecmp(subcmd, "alternate")) { scr_RosterJumpAlternate(); } else if (!strncasecmp(subcmd, "search", 6)) { - if (!*arg) { + strip_arg_special_chars(arg); + if (!arg || !*arg) { scr_LogPrint(LPRINT_NORMAL, "What name or JID are you looking for?"); free_arg_lst(paramlst); return; @@ -1102,8 +1103,10 @@ } else if (!strcasecmp(subcmd, "down")) { buffer_updown(1, arg); } else if (!strcasecmp(subcmd, "search_backward")) { + strip_arg_special_chars(arg); buffer_search(-1, arg); } else if (!strcasecmp(subcmd, "search_forward")) { + strip_arg_special_chars(arg); buffer_search(1, arg); } else if (!strcasecmp(subcmd, "date")) { buffer_date(arg); diff -r a58dfdd6d058 -r ea939ff047d8 mcabber/src/utils.c --- a/mcabber/src/utils.c Sat Oct 21 11:07:50 2006 +0200 +++ b/mcabber/src/utils.c Sat Oct 21 11:22:15 2006 +0200 @@ -383,6 +383,8 @@ int escape = FALSE; char *p; + if (!s) return; + for (p = s; *p; p++) { if (*p == '"') { if (!escape) {