summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--src/common/weechat.c25
-rw-r--r--src/common/weechat.h1
-rw-r--r--src/common/weeconfig.c4
-rw-r--r--weechat/ChangeLog3
-rw-r--r--weechat/src/common/weechat.c25
-rw-r--r--weechat/src/common/weechat.h1
-rw-r--r--weechat/src/common/weeconfig.c4
8 files changed, 60 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d8ea510c..7ef4c9c61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,10 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
-ChangeLog - 2006-06-24
+ChangeLog - 2006-06-26
Version 0.2.0 (under dev!):
+ * case ignored for channel names in charset options (bug #16858)
* fixed crash when setting look_one_server_buffer to ON (bug #16932)
* added new functions in plugin/script API: get window info,
get buffer info, get buffer content
diff --git a/src/common/weechat.c b/src/common/weechat.c
index 76d426aa0..7e99ae250 100644
--- a/src/common/weechat.c
+++ b/src/common/weechat.c
@@ -196,6 +196,31 @@ ascii_strncasecmp (char *string1, char *string2, int max)
}
/*
+ * ascii_strcasestr: locale and case independent string search
+ */
+
+char *
+ascii_strcasestr (char *string, char *search)
+{
+ int length_search;
+
+ length_search = strlen (search);
+
+ if (!string || !search || (length_search == 0))
+ return NULL;
+
+ while (string[0])
+ {
+ if (ascii_strncasecmp (string, search, length_search) == 0)
+ return string;
+
+ string++;
+ }
+
+ return NULL;
+}
+
+/*
* weechat_iconv: convert string to another charset
*/
diff --git a/src/common/weechat.h b/src/common/weechat.h
index 5c08702e4..c238008b8 100644
--- a/src/common/weechat.h
+++ b/src/common/weechat.h
@@ -108,6 +108,7 @@ extern void ascii_tolower (char *);
extern void ascii_toupper (char *);
extern int ascii_strcasecmp (char *, char *);
extern int ascii_strncasecmp (char *, char *, int);
+extern char *ascii_strcasestr (char *, char *);
extern char *weechat_iconv (char *, char *, char *);
extern char *weechat_strreplace (char *, char *, char *);
extern void weechat_dump (int);
diff --git a/src/common/weeconfig.c b/src/common/weeconfig.c
index 4a142e977..20d5604b2 100644
--- a/src/common/weeconfig.c
+++ b/src/common/weeconfig.c
@@ -1366,7 +1366,7 @@ config_option_list_remove (char **string, char *item)
name = (char *) malloc (strlen (item) + 2);
strcpy (name, item);
strcat (name, ":");
- pos = strstr (*string, name);
+ pos = ascii_strcasestr (*string, name);
free (name);
if (pos)
{
@@ -1442,7 +1442,7 @@ config_option_list_get_value (char **string, char *item,
name = (char *) malloc (strlen (item) + 2);
strcpy (name, item);
strcat (name, ":");
- pos = strstr (*string, name);
+ pos = ascii_strcasestr (*string, name);
free (name);
if (pos)
{
diff --git a/weechat/ChangeLog b/weechat/ChangeLog
index 2d8ea510c..7ef4c9c61 100644
--- a/weechat/ChangeLog
+++ b/weechat/ChangeLog
@@ -1,9 +1,10 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
-ChangeLog - 2006-06-24
+ChangeLog - 2006-06-26
Version 0.2.0 (under dev!):
+ * case ignored for channel names in charset options (bug #16858)
* fixed crash when setting look_one_server_buffer to ON (bug #16932)
* added new functions in plugin/script API: get window info,
get buffer info, get buffer content
diff --git a/weechat/src/common/weechat.c b/weechat/src/common/weechat.c
index 76d426aa0..7e99ae250 100644
--- a/weechat/src/common/weechat.c
+++ b/weechat/src/common/weechat.c
@@ -196,6 +196,31 @@ ascii_strncasecmp (char *string1, char *string2, int max)
}
/*
+ * ascii_strcasestr: locale and case independent string search
+ */
+
+char *
+ascii_strcasestr (char *string, char *search)
+{
+ int length_search;
+
+ length_search = strlen (search);
+
+ if (!string || !search || (length_search == 0))
+ return NULL;
+
+ while (string[0])
+ {
+ if (ascii_strncasecmp (string, search, length_search) == 0)
+ return string;
+
+ string++;
+ }
+
+ return NULL;
+}
+
+/*
* weechat_iconv: convert string to another charset
*/
diff --git a/weechat/src/common/weechat.h b/weechat/src/common/weechat.h
index 5c08702e4..c238008b8 100644
--- a/weechat/src/common/weechat.h
+++ b/weechat/src/common/weechat.h
@@ -108,6 +108,7 @@ extern void ascii_tolower (char *);
extern void ascii_toupper (char *);
extern int ascii_strcasecmp (char *, char *);
extern int ascii_strncasecmp (char *, char *, int);
+extern char *ascii_strcasestr (char *, char *);
extern char *weechat_iconv (char *, char *, char *);
extern char *weechat_strreplace (char *, char *, char *);
extern void weechat_dump (int);
diff --git a/weechat/src/common/weeconfig.c b/weechat/src/common/weeconfig.c
index 4a142e977..20d5604b2 100644
--- a/weechat/src/common/weeconfig.c
+++ b/weechat/src/common/weeconfig.c
@@ -1366,7 +1366,7 @@ config_option_list_remove (char **string, char *item)
name = (char *) malloc (strlen (item) + 2);
strcpy (name, item);
strcat (name, ":");
- pos = strstr (*string, name);
+ pos = ascii_strcasestr (*string, name);
free (name);
if (pos)
{
@@ -1442,7 +1442,7 @@ config_option_list_get_value (char **string, char *item,
name = (char *) malloc (strlen (item) + 2);
strcpy (name, item);
strcat (name, ":");
- pos = strstr (*string, name);
+ pos = ascii_strcasestr (*string, name);
free (name);
if (pos)
{