diff options
-rw-r--r-- | acconfig.h | 30 | ||||
-rw-r--r-- | configure.ac | 74 | ||||
-rw-r--r-- | docs/help/in/away.in | 4 | ||||
-rw-r--r-- | docs/help/in/hilight.in | 1 | ||||
-rw-r--r-- | src/common.h | 2 | ||||
-rw-r--r-- | src/fe-common/core/fe-messages.c | 5 | ||||
-rw-r--r-- | src/fe-common/core/hilight-text.c | 147 | ||||
-rw-r--r-- | src/fe-common/core/hilight-text.h | 1 | ||||
-rw-r--r-- | src/fe-common/core/themes.c | 2 | ||||
-rw-r--r-- | src/fe-text/gui-entry.c | 9 | ||||
-rw-r--r-- | src/fe-text/gui-readline.c | 3 | ||||
-rw-r--r-- | src/fe-text/statusbar.c | 2 | ||||
-rw-r--r-- | src/irc/proxy/proxy.c | 3 |
13 files changed, 158 insertions, 125 deletions
diff --git a/acconfig.h b/acconfig.h deleted file mode 100644 index 53e268d7..00000000 --- a/acconfig.h +++ /dev/null @@ -1,30 +0,0 @@ -/* misc.. */ -#undef HAVE_SOCKS_H -#undef HAVE_STATIC_PERL -#undef HAVE_GMODULE - -/* macros/curses checks */ -#undef HAS_CURSES -#undef USE_SUNOS_CURSES -#undef USE_BSD_CURSES -#undef USE_SYSV_CURSES -#undef USE_NCURSES -#undef NO_COLOR_CURSES -#undef SCO_FLAVOR - -/* our own curses checks */ -#undef HAVE_NCURSES_USE_DEFAULT_COLORS -#undef HAVE_CURSES_IDCOK -#undef HAVE_CURSES_RESIZETERM -#undef HAVE_CURSES_WRESIZE - -/* terminfo/termcap */ -#undef HAVE_TERMINFO - -/* What type should be used for uoff_t */ -#undef UOFF_T_INT -#undef UOFF_T_LONG -#undef UOFF_T_LONG_LONG - -/* printf()-format for uoff_t, eg. "u" or "lu" or "llu" */ -#undef PRIuUOFF_T diff --git a/configure.ac b/configure.ac index 2c47bd2b..04e2b0b3 100644 --- a/configure.ac +++ b/configure.ac @@ -79,7 +79,6 @@ AC_ARG_WITH(modules, if test "x$prefix" != "xNONE"; then prefix=`eval echo $prefix` PERL_MM_PARAMS="INSTALLDIRS=perl INSTALL_BASE=$prefix" - perl_library_dir="PERL_USE_LIB" perl_set_use_lib=yes perl_prefix_note=yes @@ -97,30 +96,35 @@ AC_ARG_WITH(perl-staticlib, AC_ARG_WITH(perl-lib, -[ --with-perl-lib=[site|vendor|DIR] Specify where to install the +[ --with-perl-lib=[perl|site|vendor|DIR] Specify where to install the Perl libraries for irssi, default is site], if test "x$withval" = xyes; then want_perl=yes elif test "x$withval" = xno; then want_perl=no + elif test "x$withval" = xperl; then + want_perl=yes + perl_prefix_note=no + PERL_MM_PARAMS="INSTALLDIRS=perl" + perl_set_use_lib=no elif test "x$withval" = xsite; then want_perl=yes perl_prefix_note=no PERL_MM_PARAMS="" + perl_set_use_lib=no elif test "x$withval" = xvendor; then want_perl=yes perl_prefix_note=no if test -z "`$perlpath -v|grep '5\.0'`"; then PERL_MM_PARAMS="INSTALLDIRS=vendor" else - PERL_MM_PARAMS="INSTALLDIRS=perl PREFIX=`perl -e 'use Config; print $Config{prefix}'`" + PERL_MM_PARAMS="INSTALLDIRS=perl PREFIX=`$perlpath -e 'use Config; print $Config{prefix}'`" fi - perl_library_dir="(vendor default - `$perlpath -e 'use Config; print $Config{archlib}'`)" + perl_set_use_lib=no else want_perl=yes perl_prefix_note=no PERL_MM_PARAMS="INSTALLDIRS=perl LIB=$withval" - perl_library_dir="PERL_USE_LIB" perl_set_use_lib=yes fi, want_perl=yes) @@ -371,7 +375,7 @@ if test "$want_perl" != "no"; then dnl * complain about them. Normally there's only few options dnl * that we want to keep: dnl * -Ddefine -Uundef -I/path -fopt -mopt - PERL_CFLAGS=`echo $PERL_CFLAGS | $perlpath -pe 's/^(.* )?-[^DUIfm][^ ]+/\1/g; s/^(.* )?\+[^ ]+/\1/g'` + PERL_CFLAGS=`echo $PERL_CFLAGS | $perlpath -pe 's/^(.* )?-@<:@^DUIfm@:>@@<:@^ @:>@+/\1/g; s/^(.* )?\+@<:@^ @:>@+/\1/g'` PERL_EXTRA_OPTS="CCCDLFLAGS=\"-fPIC\"" AC_SUBST(PERL_EXTRA_OPTS) @@ -455,13 +459,37 @@ if test "$want_perl" != "no"; then PERL_STATIC_LIBS=0 fi + # remove any prefix from PERL_MM_OPT + PERL_MM_OPT=`perl -MText::ParseWords -e 'sub qu{$_=shift;s{^(.*?)=(.*)$}{($a,$b)=($1,$2);$b=~s/"/\\\\"/g;qq{$a="$b"}}ge if /@<:@\s"@:>@/;$_} local $,=" "; print map qu($_), grep !/^(INSTALL_BASE|PREFIX)=/, shellwords(@ARGV)' "$PERL_MM_OPT"` # figure out the correct @INC path - we'll need to do this # through MakeMaker since it's difficult to get it right # otherwise. + $perlpath -MExtUtils::MakeMaker -e 'WriteMakefile(NAME => "test", MAKEFILE => "Makefile.test", FIRST_MAKEFILE => "/dev/null", NO_META => 1, NO_MYMETA => 1);' $PERL_MM_PARAMS >/dev/null + echo 'show-INSTALLDIRS:' >> Makefile.test + echo ' @echo $(INSTALLDIRS)' >> Makefile.test + perl_INSTALLDIRS=`$am_make -s -f Makefile.test show-INSTALLDIRS` + if test "x$perl_INSTALLDIRS" = "xsite"; then + perl_library_dir="site default" + perl_INSTALL_VAR=INSTALLSITEARCH + elif test "x$perl_INSTALLDIRS" = "xvendor"; then + perl_library_dir="vendor default" + perl_INSTALL_VAR=INSTALLVENDORARCH + else + perl_library_dir="module default" + perl_INSTALL_VAR=INSTALLARCHLIB + fi + echo 'show-ARCHLIB:' >> Makefile.test + echo ' @echo $('"$perl_INSTALL_VAR"')' >> Makefile.test + perl_use_lib=`$am_make -s -f Makefile.test show-ARCHLIB` + rm -f Makefile.test if test "x$perl_set_use_lib" = "xyes"; then - perl -e 'use ExtUtils::MakeMaker; WriteMakefile("NAME" => "test", "MAKEFILE" => "Makefile.test");' $PERL_MM_PARAMS >/dev/null - PERL_USE_LIB=`perl -e 'open(F, "Makefile.test"); while (<F>) { chomp; if (/^(\w+) = (.*$)/) { $keys{$1} = $2; } }; $key = $keys{INSTALLARCHLIB}; while ($key =~ /\\$\((\w+)\)/) { $value = $keys{$1}; $key =~ s/\\$\($1\)/$value/; }; print $key;'` - rm -f Makefile.test + if $perlpath -e 'exit ! grep $_ eq $ARGV@<:@0@:>@, grep /^\//, @INC' "$perl_use_lib"; then + perl_library_dir="other path in @INC" + perl_set_use_lib=no + else + perl_library_dir="prepends to @INC with /set perl_use_lib" + PERL_USE_LIB="$perl_use_lib" + fi fi AC_SUBST(perl_module_lib) @@ -477,6 +505,7 @@ if test "$want_perl" != "no"; then AC_SUBST(PERL_CFLAGS) AC_SUBST(PERL_USE_LIB) + AC_SUBST(PERL_MM_OPT) AC_SUBST(PERL_MM_PARAMS) AC_SUBST(PERL_STATIC_LIBS) fi @@ -591,6 +620,25 @@ else want_truecolor=no fi +AH_TEMPLATE(HAS_CURSES, [macros/curses checks]) +AH_TEMPLATE(HAVE_CURSES_IDCOK) +AH_TEMPLATE(HAVE_CURSES_RESIZETERM) +AH_TEMPLATE(HAVE_CURSES_WRESIZE) +AH_TEMPLATE(HAVE_GMODULE) +AH_TEMPLATE(HAVE_NCURSES_USE_DEFAULT_COLORS, [our own curses checks]) +AH_TEMPLATE(HAVE_SOCKS_H, [misc..]) +AH_TEMPLATE(HAVE_STATIC_PERL) +AH_TEMPLATE(HAVE_TERMINFO, [terminfo/termcap]) +AH_TEMPLATE(NO_COLOR_CURSES) +AH_TEMPLATE(PRIuUOFF_T, [printf()-format for uoff_t, eg. "u" or "lu" or "llu"]) +AH_TEMPLATE(SCO_FLAVOR) +AH_TEMPLATE(UOFF_T_INT, [What type should be used for uoff_t]) +AH_TEMPLATE(UOFF_T_LONG) +AH_TEMPLATE(UOFF_T_LONG_LONG) +AH_TEMPLATE(USE_NCURSES) +AH_TEMPLATE(USE_SUNOS_CURSES) +AH_TEMPLATE(USE_SYSV_CURSES) + AC_CONFIG_FILES([ Makefile src/Makefile @@ -692,13 +740,7 @@ if test "x$want_perl" != "xno" -a "x$perl_mod_error" != "x"; then fi if test "x$want_perl" != "xno"; then - if test "$perl_library_dir" = "PERL_USE_LIB"; then - perl_library_dir=$PERL_USE_LIB - fi - if test -z "$perl_library_dir"; then - perl_library_dir="(site default - `$perlpath -e 'use Config; print $Config{sitearch}'`)" - fi - echo "Perl library directory ........... : $perl_library_dir" + echo "Perl library directory ........... : ($perl_library_dir - $perl_use_lib)" if test "x$perl_prefix_note" = "xyes"; then echo " - NOTE: This was automatically set to the same directory you gave with" echo " --prefix. If you want the perl libraries to install to their 'correct'" diff --git a/docs/help/in/away.in b/docs/help/in/away.in index e0cf3685..75bc46c4 100644 --- a/docs/help/in/away.in +++ b/docs/help/in/away.in @@ -8,8 +8,8 @@ -one: Marks yourself as away on the active server. -all: Marks yourself as away on all the servers you are connected to. - You away message; if no argument is given, your away status will be removed. - + Your away message; if no argument is given, your away status will be removed. + %9Description:%9 Marks yourself as 'away'; this method is used to inform people that you diff --git a/docs/help/in/hilight.in b/docs/help/in/hilight.in index fabbc2ea..2f396430 100644 --- a/docs/help/in/hilight.in +++ b/docs/help/in/hilight.in @@ -10,6 +10,7 @@ -line: Highlights the whole line. -mask: Highlights all messages from users matching the mask. -full: The text must match the full word. + -matchcase: The text must match case. -regexp: The text is a regular expression. -color: The color the display the highlight in. -actcolor: The color to mark the highlight activity in the statusbar. diff --git a/src/common.h b/src/common.h index 33dbd481..4fd6d331 100644 --- a/src/common.h +++ b/src/common.h @@ -6,7 +6,7 @@ #define IRSSI_GLOBAL_CONFIG "irssi.conf" /* config file name in /etc/ */ #define IRSSI_HOME_CONFIG "config" /* config file name in ~/.irssi/ */ -#define IRSSI_ABI_VERSION 3 +#define IRSSI_ABI_VERSION 4 #define DEFAULT_SERVER_ADD_PORT 6667 diff --git a/src/fe-common/core/fe-messages.c b/src/fe-common/core/fe-messages.c index 3240fd10..bc2a30d6 100644 --- a/src/fe-common/core/fe-messages.c +++ b/src/fe-common/core/fe-messages.c @@ -175,6 +175,7 @@ static void sig_message_public(SERVER_REC *server, const char *msg, int for_me, print_channel, level; char *nickmode, *color, *freemsg = NULL; HILIGHT_REC *hilight; + TEXT_DEST_REC dest; /* NOTE: this may return NULL if some channel is just closed with /WINDOW CLOSE and server still sends the few last messages */ @@ -214,7 +215,6 @@ static void sig_message_public(SERVER_REC *server, const char *msg, if (printnick == NULL) printnick = nick; - TEXT_DEST_REC dest; format_create_dest(&dest, server, target, level, NULL); dest.address = address; dest.nick = nick; @@ -396,8 +396,9 @@ static void sig_message_quit(SERVER_REC *server, const char *nick, count = 0; windows = NULL; chans = g_string_new(NULL); for (tmp = server->channels; tmp != NULL; tmp = tmp->next) { + CHANNEL_REC *rec; level = MSGLEVEL_QUITS; - CHANNEL_REC *rec = tmp->data; + rec = tmp->data; if (!nicklist_find(rec, nick)) continue; diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index b746f636..36e1e78c 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -49,7 +49,7 @@ static void reset_level_cache(void) HILIGHT_REC *rec = tmp->data; if (never_hilight_level & rec->level) - never_hilight_level &= ~rec->level; + never_hilight_level &= ~rec->level; } } @@ -68,17 +68,18 @@ static void hilight_add_config(HILIGHT_REC *rec) node = iconfig_node_traverse("(hilights", TRUE); node = iconfig_node_section(node, NULL, NODE_TYPE_BLOCK); - iconfig_node_set_str(node, "text", rec->text); - if (rec->level > 0) iconfig_node_set_int(node, "level", rec->level); - if (rec->color) iconfig_node_set_str(node, "color", rec->color); - if (rec->act_color) iconfig_node_set_str(node, "act_color", rec->act_color); - if (rec->priority > 0) iconfig_node_set_int(node, "priority", rec->priority); - iconfig_node_set_bool(node, "nick", rec->nick); - iconfig_node_set_bool(node, "word", rec->word); - if (rec->nickmask) iconfig_node_set_bool(node, "mask", TRUE); - if (rec->fullword) iconfig_node_set_bool(node, "fullword", TRUE); - if (rec->regexp) iconfig_node_set_bool(node, "regexp", TRUE); - if (rec->servertag) iconfig_node_set_str(node, "servertag", rec->servertag); + iconfig_node_set_str(node, "text", rec->text); + if (rec->level > 0) iconfig_node_set_int(node, "level", rec->level); + if (rec->color) iconfig_node_set_str(node, "color", rec->color); + if (rec->act_color) iconfig_node_set_str(node, "act_color", rec->act_color); + if (rec->priority > 0) iconfig_node_set_int(node, "priority", rec->priority); + iconfig_node_set_bool(node, "nick", rec->nick); + iconfig_node_set_bool(node, "word", rec->word); + if (rec->nickmask) iconfig_node_set_bool(node, "mask", TRUE); + if (rec->fullword) iconfig_node_set_bool(node, "fullword", TRUE); + if (rec->regexp) iconfig_node_set_bool(node, "regexp", TRUE); + if (rec->case_sensitive) iconfig_node_set_bool(node, "matchcase", TRUE); + if (rec->servertag) iconfig_node_set_str(node, "servertag", rec->servertag); if (rec->channels != NULL && *rec->channels != NULL) { node = iconfig_node_section(node, "channels", NODE_TYPE_LIST); @@ -121,8 +122,11 @@ static void hilight_init_rec(HILIGHT_REC *rec) { #ifdef HAVE_REGEX_H if (rec->regexp_compiled) regfree(&rec->preg); - rec->regexp_compiled = !rec->regexp ? FALSE : - regcomp(&rec->preg, rec->text, REG_EXTENDED|REG_ICASE) == 0; + if (!rec->regexp) + rec->regexp_compiled = FALSE; + else + rec->regexp_compiled = regcomp(&rec->preg, rec->text, + rec->case_sensitive ? REG_EXTENDED : (REG_EXTENDED|REG_ICASE)) == 0; #endif } @@ -191,7 +195,7 @@ static HILIGHT_REC *hilight_find(const char *text, char **channels) } static int hilight_match_text(HILIGHT_REC *rec, const char *text, - int *match_beg, int *match_end) + int *match_beg, int *match_end) { char *match; @@ -200,9 +204,9 @@ static int hilight_match_text(HILIGHT_REC *rec, const char *text, regmatch_t rmatch[1]; if (rec->regexp_compiled && - regexec(&rec->preg, text, 1, rmatch, 0) == 0) { + regexec(&rec->preg, text, 1, rmatch, 0) == 0) { if (rmatch[0].rm_so > 0 && - match_beg != NULL && match_end != NULL) { + match_beg != NULL && match_end != NULL) { *match_beg = rmatch[0].rm_so; *match_end = rmatch[0].rm_eo; } @@ -210,9 +214,15 @@ static int hilight_match_text(HILIGHT_REC *rec, const char *text, } #endif } else { - match = rec->fullword ? - stristr_full(text, rec->text) : - stristr(text, rec->text); + if (rec->case_sensitive) { + match = rec->fullword ? + strstr_full(text, rec->text) : + strstr(text, rec->text); + } else { + match = rec->fullword ? + stristr_full(text, rec->text) : + stristr(text, rec->text); + } if (match != NULL) { if (match_beg != NULL && match_end != NULL) { *match_beg = (int) (match-text); @@ -222,7 +232,7 @@ static int hilight_match_text(HILIGHT_REC *rec, const char *text, } } - return FALSE; + return FALSE; } #define hilight_match_level(rec, level) \ @@ -267,14 +277,14 @@ HILIGHT_REC *hilight_match(SERVER_REC *server, const char *channel, HILIGHT_REC *rec = tmp->data; if (!rec->nickmask && hilight_match_level(rec, level) && - hilight_match_channel(rec, channel) && - (rec->servertag == NULL || - (server != NULL && g_ascii_strcasecmp(rec->servertag, server->tag) == 0)) && - hilight_match_text(rec, str, match_beg, match_end)) + hilight_match_channel(rec, channel) && + (rec->servertag == NULL || + (server != NULL && g_ascii_strcasecmp(rec->servertag, server->tag) == 0)) && + hilight_match_text(rec, str, match_beg, match_end)) return rec; } - return NULL; + return NULL; } static char *hilight_get_act_color(HILIGHT_REC *rec) @@ -308,7 +318,7 @@ void hilight_update_text_dest(TEXT_DEST_REC *dest, HILIGHT_REC *rec) g_free_and_null(dest->hilight_color); if (rec->act_color != NULL && g_strcmp0(rec->act_color, "%n") == 0) dest->level |= MSGLEVEL_NO_ACT; - else + else dest->hilight_color = hilight_get_act_color(rec); } @@ -362,29 +372,29 @@ static void sig_print_text(TEXT_DEST_REC *dest, const char *text, /* hilight whole line */ char *tmp = strip_codes(text); newstr = g_strconcat(color, tmp, NULL); - g_free(tmp); + g_free(tmp); } else { /* hilight part of the line */ - GString *tmp; - char *middle; + GString *tmp; + char *middle; int pos, color_pos, color_len; - tmp = g_string_new(NULL); + tmp = g_string_new(NULL); - /* start of the line */ + /* start of the line */ pos = strip_real_length(text, hilight_start, NULL, NULL); g_string_append(tmp, text); - g_string_truncate(tmp, pos); + g_string_truncate(tmp, pos); /* color */ - g_string_append(tmp, color); + g_string_append(tmp, color); /* middle of the line, stripped */ middle = strip_codes(text+pos); - pos = tmp->len; + pos = tmp->len; g_string_append(tmp, middle); - g_string_truncate(tmp, pos+hilight_len); - g_free(middle); + g_string_truncate(tmp, pos+hilight_len); + g_free(middle); /* end of the line */ pos = strip_real_length(text, hilight_end, @@ -398,8 +408,8 @@ static void sig_print_text(TEXT_DEST_REC *dest, const char *text, } g_string_append(tmp, text+pos); - newstr = tmp->str; - g_string_free(tmp, FALSE); + newstr = tmp->str; + g_string_free(tmp, FALSE); } signal_emit("print text", 3, dest, newstr, stripped); @@ -417,7 +427,7 @@ HILIGHT_REC *hilight_match_nick(SERVER_REC *server, const char *channel, HILIGHT_REC *rec; rec = hilight_match(server, channel, nick, address, - level, msg, NULL, NULL); + level, msg, NULL, NULL); return (rec == NULL || !rec->nick) ? NULL : rec; } @@ -464,6 +474,7 @@ static void read_hilight_config(void) rec->priority = config_node_get_int(node, "priority", 0); rec->nick = config_node_get_bool(node, "nick", TRUE); rec->word = config_node_get_bool(node, "word", TRUE); + rec->case_sensitive = config_node_get_bool(node, "matchcase", FALSE); rec->nickmask = config_node_get_bool(node, "mask", FALSE); rec->fullword = config_node_get_bool(node, "fullword", FALSE); @@ -475,7 +486,7 @@ static void read_hilight_config(void) if (node != NULL) rec->channels = config_node_get_list(node); } - reset_cache(); + reset_cache(); } static void hilight_print(int index, HILIGHT_REC *rec) @@ -495,6 +506,7 @@ static void hilight_print(int index, HILIGHT_REC *rec) if (rec->nickmask) g_string_append(options, "-mask "); if (rec->fullword) g_string_append(options, "-full "); + if (rec->case_sensitive) g_string_append(options, "-matchcase "); if (rec->regexp) { g_string_append(options, "-regexp "); #ifdef HAVE_REGEX_H @@ -519,10 +531,10 @@ static void hilight_print(int index, HILIGHT_REC *rec) if (levelstr != NULL) levelstr = g_strconcat(levelstr, " ", NULL); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, - TXT_HILIGHT_LINE, index, rec->text, - chans != NULL ? chans : "", - levelstr != NULL ? levelstr : "", - options->str); + TXT_HILIGHT_LINE, index, rec->text, + chans != NULL ? chans : "", + levelstr != NULL ? levelstr : "", + options->str); g_free_not_null(chans); g_free_not_null(levelstr); g_string_free(options, TRUE); @@ -543,12 +555,12 @@ static void cmd_hilight_show(void) printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_HILIGHT_FOOTER); } -/* SYNTAX: HILIGHT [-nick | -word | -line] [-mask | -full | -regexp] +/* SYNTAX: HILIGHT [-nick | -word | -line] [-mask | -full | -matchcase | -regexp] [-color <color>] [-actcolor <color>] [-level <level>] [-network <network>] [-channels <channels>] <text> */ static void cmd_hilight(const char *data) { - GHashTable *optlist; + GHashTable *optlist; HILIGHT_REC *rec; char *colorarg, *actcolorarg, *levelarg, *priorityarg, *chanarg, *text, *servertag; char **channels; @@ -562,7 +574,7 @@ static void cmd_hilight(const char *data) } if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS | - PARAM_FLAG_GETREST, "hilight", &optlist, &text)) + PARAM_FLAG_GETREST, "hilight", &optlist, &text)) return; chanarg = g_hash_table_lookup(optlist, "channels"); @@ -582,7 +594,7 @@ static void cmd_hilight(const char *data) rec = g_new0(HILIGHT_REC, 1); /* default to nick/word hilighting */ - rec->nick = TRUE; + rec->nick = TRUE; rec->word = TRUE; rec->text = g_strdup(text); @@ -602,15 +614,16 @@ static void cmd_hilight(const char *data) if (g_hash_table_lookup(optlist, "word") != NULL) { rec->word = TRUE; - rec->nick = FALSE; + rec->nick = FALSE; } if (g_hash_table_lookup(optlist, "nick") != NULL) - rec->nick = TRUE; + rec->nick = TRUE; rec->nickmask = g_hash_table_lookup(optlist, "mask") != NULL; rec->fullword = g_hash_table_lookup(optlist, "full") != NULL; rec->regexp = g_hash_table_lookup(optlist, "regexp") != NULL; + rec->case_sensitive = g_hash_table_lookup(optlist, "matchcase") != NULL; if (colorarg != NULL) { g_free_and_null(rec->color); @@ -631,7 +644,7 @@ static void cmd_hilight(const char *data) hilight_create(rec); hilight_print(g_slist_index(hilights, rec)+1, rec); - cmd_params_free(free_arg); + cmd_params_free(free_arg); reset_cache(); } @@ -649,7 +662,7 @@ static void cmd_dehilight(const char *data) } else { /* with mask */ char *chans[2] = { "*", NULL }; - rec = hilight_find(data, chans); + rec = hilight_find(data, chans); } if (rec == NULL) @@ -657,20 +670,20 @@ static void cmd_dehilight(const char *data) else { printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_HILIGHT_REMOVED, rec->text); hilight_remove(rec); - reset_cache(); + reset_cache(); } } static void hilight_nick_cache(GHashTable *list, CHANNEL_REC *channel, - NICK_REC *nick) + NICK_REC *nick) { GSList *tmp; HILIGHT_REC *match; - char *nickmask; + char *nickmask; int len, best_match; if (nick->host == NULL) - return; /* don't check until host is known */ + return; /* don't check until host is known */ nickmask = g_strconcat(nick->nick, "!", nick->host, NULL); @@ -679,8 +692,8 @@ static void hilight_nick_cache(GHashTable *list, CHANNEL_REC *channel, HILIGHT_REC *rec = tmp->data; if (rec->nickmask && - hilight_match_channel(rec, channel->name) && - match_wildcards(rec->text, nickmask)) { + hilight_match_channel(rec, channel->name) && + match_wildcards(rec->text, nickmask)) { len = strlen(rec->text); if (best_match < len) { best_match = len; @@ -691,7 +704,7 @@ static void hilight_nick_cache(GHashTable *list, CHANNEL_REC *channel, g_free_not_null(nickmask); if (match != NULL) - g_hash_table_insert(list, nick, match); + g_hash_table_insert(list, nick, match); } static void read_settings(void) @@ -706,28 +719,28 @@ void hilight_text_init(void) settings_add_str("lookandfeel", "hilight_act_color", "%M"); settings_add_level("lookandfeel", "hilight_level", "PUBLIC DCCMSGS"); - read_settings(); + read_settings(); nickmatch = nickmatch_init(hilight_nick_cache); read_hilight_config(); signal_add_first("print text", (SIGNAL_FUNC) sig_print_text); - signal_add("setup reread", (SIGNAL_FUNC) read_hilight_config); - signal_add("setup changed", (SIGNAL_FUNC) read_settings); + signal_add("setup reread", (SIGNAL_FUNC) read_hilight_config); + signal_add("setup changed", (SIGNAL_FUNC) read_settings); command_bind("hilight", NULL, (SIGNAL_FUNC) cmd_hilight); command_bind("dehilight", NULL, (SIGNAL_FUNC) cmd_dehilight); - command_set_options("hilight", "-color -actcolor -level -priority -network -channels nick word line mask full regexp"); + command_set_options("hilight", "-color -actcolor -level -priority -network -channels nick word line mask full regexp matchcase"); } void hilight_text_deinit(void) { hilights_destroy_all(); - nickmatch_deinit(nickmatch); + nickmatch_deinit(nickmatch); signal_remove("print text", (SIGNAL_FUNC) sig_print_text); - signal_remove("setup reread", (SIGNAL_FUNC) read_hilight_config); - signal_remove("setup changed", (SIGNAL_FUNC) read_settings); + signal_remove("setup reread", (SIGNAL_FUNC) read_hilight_config); + signal_remove("setup changed", (SIGNAL_FUNC) read_settings); command_unbind("hilight", (SIGNAL_FUNC) cmd_hilight); command_unbind("dehilight", (SIGNAL_FUNC) cmd_dehilight); diff --git a/src/fe-common/core/hilight-text.h b/src/fe-common/core/hilight-text.h index 3c897def..ae05e1ca 100644 --- a/src/fe-common/core/hilight-text.h +++ b/src/fe-common/core/hilight-text.h @@ -23,6 +23,7 @@ struct _HILIGHT_REC { unsigned int nickmask:1; /* `text' is a nick mask */ unsigned int fullword:1; /* match `text' only for full words */ unsigned int regexp:1; /* `text' is a regular expression */ + unsigned int case_sensitive:1;/* `text' must match case */ #ifdef HAVE_REGEX_H unsigned int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */ regex_t preg; diff --git a/src/fe-common/core/themes.c b/src/fe-common/core/themes.c index 58e7b557..2b1459be 100644 --- a/src/fe-common/core/themes.c +++ b/src/fe-common/core/themes.c @@ -365,9 +365,9 @@ char *theme_format_expand_get(THEME_REC *theme, const char **format) GString *str; char *ret; theme_rm_col dummy, reset; + int braces = 1; /* we start with one brace opened */ dummy.m[0] = '\0'; strcpy(reset.m, "n"); - int braces = 1; /* we start with one brace opened */ str = g_string_new(NULL); while (**format != '\0' && braces != 0) { diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c index 949a43d3..82645a8e 100644 --- a/src/fe-text/gui-entry.c +++ b/src/fe-text/gui-entry.c @@ -540,6 +540,7 @@ void gui_entry_insert_char(GUI_ENTRY_REC *entry, unichar chr) char *gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry) { + GUI_ENTRY_CUTBUFFER_REC *tmp; char *buf; int i; @@ -548,7 +549,7 @@ char *gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry) if (entry->kill_ring == NULL || entry->kill_ring->data == NULL) return NULL; - GUI_ENTRY_CUTBUFFER_REC *tmp = entry->kill_ring->data; + tmp = entry->kill_ring->data; if (tmp->cutbuffer == NULL) return NULL; @@ -568,12 +569,14 @@ char *gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry) char *gui_entry_get_next_cutbuffer(GUI_ENTRY_REC *entry) { + GUI_ENTRY_CUTBUFFER_REC *tmp; + g_return_val_if_fail(entry != NULL, NULL); if (entry->kill_ring == NULL) return NULL; - GUI_ENTRY_CUTBUFFER_REC *tmp = entry->kill_ring->data; + tmp = entry->kill_ring->data; entry->kill_ring = g_slist_remove(entry->kill_ring, tmp); entry->kill_ring = g_slist_append(entry->kill_ring, tmp); @@ -594,7 +597,7 @@ void gui_entry_erase_to(GUI_ENTRY_REC *entry, int pos, CUTBUFFER_UPDATE_OP updat static GUI_ENTRY_CUTBUFFER_REC *get_cutbuffer_rec(GUI_ENTRY_REC *entry, CUTBUFFER_UPDATE_OP update_cutbuffer) { - GUI_ENTRY_CUTBUFFER_REC *tmp = NULL; + GUI_ENTRY_CUTBUFFER_REC *tmp; g_return_val_if_fail(entry != NULL, NULL); diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c index e0ffb4f1..7c71edd7 100644 --- a/src/fe-text/gui-readline.c +++ b/src/fe-text/gui-readline.c @@ -696,10 +696,11 @@ static void key_append_next_kill(void) static gboolean paste_timeout(gpointer data) { + int split_lines; paste_was_bracketed_mode = paste_bracketed_mode; /* number of lines after splitting extra-long messages */ - int split_lines = paste_buffer->len / LINE_SPLIT_LIMIT; + split_lines = paste_buffer->len / LINE_SPLIT_LIMIT; /* Take into account the fact that a line may be split every LINE_SPLIT_LIMIT characters */ if (paste_line_count == 0 && split_lines <= paste_verify_line_count) { diff --git a/src/fe-text/statusbar.c b/src/fe-text/statusbar.c index 5448243a..f0dff828 100644 --- a/src/fe-text/statusbar.c +++ b/src/fe-text/statusbar.c @@ -671,8 +671,8 @@ void statusbar_item_default_handler(SBAR_ITEM_REC *item, int get_size_only, WI_ITEM_REC *wiitem; char *tmpstr, *tmpstr2; theme_rm_col reset; - strcpy(reset.m, "n"); int len; + strcpy(reset.m, "n"); if (str == NULL) str = statusbar_item_get_value(item); diff --git a/src/irc/proxy/proxy.c b/src/irc/proxy/proxy.c index 1a714045..2875d2c2 100644 --- a/src/irc/proxy/proxy.c +++ b/src/irc/proxy/proxy.c @@ -28,13 +28,14 @@ /* SYNTAX: IRSSIPROXY STATUS */ static void cmd_irssiproxy_status(const char *data, IRC_SERVER_REC *server) { + GSList *tmp; + if (!settings_get_bool("irssiproxy")) { printtext(server, NULL, MSGLEVEL_CLIENTNOTICE, "Proxy is currently disabled"); return; } - GSList *tmp; printtext(server, NULL, MSGLEVEL_CLIENTNOTICE, "Proxy: Currently connected clients: %d", |