cvs: php4 /ext/ircg ircg.c
| From: | Sascha Schumann | Date: | Tue, 09 Jan 2001 00:11:48 +0000 |
| Subject: | cvs: php4 /ext/ircg ircg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-3497@lists.php.net to get a copy of this message | ||
sas Mon Jan 8 16:11:48 2001 EDT
Modified files:
/php4/ext/ircg ircg.c
Log:
Kill a warning, initialize some variables properly in mirc_colors(),
and make the standard output XHTML compatible (to a certain degree).
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.5 php4/ext/ircg/ircg.c:1.6
--- php4/ext/ircg/ircg.c:1.5 Wed Nov 15 17:24:25 2000
+++ php4/ext/ircg/ircg.c Mon Jan 8 16:11:48 2001
@@ -69,13 +69,13 @@
} php_irconn_t;
static char *fmt_msgs_default[] = {
- "%f@%c: %m<br>",
- "%f: %m<br>",
- "To %t: %m<br>",
- "%f leaves %c<br>",
- "%f joins %c<br>",
- "%t was kicked by %f from %c (%m)<br>",
- "%f changes topic on %c to %m<br>"
+ "%f@%c: %m<br />",
+ "%f: %m<br />",
+ "To %t: %m<br />",
+ "%f leaves %c<br />",
+ "%f joins %c<br />",
+ "%t was kicked by %f from %c (%m)<br />",
+ "%f changes topic on %c to %m<br />"
};
#define MSG(conn, type) \
@@ -138,8 +138,9 @@
static void mirc_color(const char *input, smart_str *result)
{
int mode = 0;
- char *p, c;
- int fg, bg;
+ const char *p;
+ char c;
+ int fg = -1, bg = -1;
int font_open = 0;
for (p = input; (c = *p); p++) {
@@ -151,11 +152,11 @@
bg = fg = -1;
} else {
if (font_open) {
- smart_str_appends_ex(result, "</FONT>", 1);
+ smart_str_appends_ex(result, "</font>", 1);
font_open = 0;
}
if (fg >= 0 && fg <= 15) {
- smart_str_appends_ex(result, "<FONT COLOR=\"", 1);
+ smart_str_appends_ex(result, "<font color=\"", 1);
smart_str_appends_ex(result, color_list[fg], 1);
smart_str_appends_ex(result, "\">", 1);
font_open = 1;
@@ -196,7 +197,7 @@
}
}
if (font_open) {
- smart_str_appends_ex(result, "</FONT>", 1);
+ smart_str_appends_ex(result, "</font>", 1);
font_open = 0;
}
}