Improve /buffer search_*
Quotes can be used in search strings, for example one can search for
" is " now (with spaces around the word).
--- 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);
--- 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) {