cvs: php4 /ext/mbstring mbfilter_ru.c

From: Date: Thu, 30 May 2002 10:10:16 +0000
Subject: cvs: php4 /ext/mbstring mbfilter_ru.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-12164@lists.php.net to get a copy of this message
dets Thu May 30 06:10:16 2002 EDT Modified files: /php4/ext/mbstring mbfilter_ru.c Log: Fixes some dummy errors (again). Index: php4/ext/mbstring/mbfilter_ru.c diff -u php4/ext/mbstring/mbfilter_ru.c:1.4 php4/ext/mbstring/mbfilter_ru.c:1.5 --- php4/ext/mbstring/mbfilter_ru.c:1.4 Wed May 29 04:33:23 2002 +++ php4/ext/mbstring/mbfilter_ru.c Thu May 30 06:10:16 2002 @@ -20,7 +20,7 @@ * "russian code filter and converter" */ -/* $Id: mbfilter_ru.c,v 1.4 2002/05/29 08:33:23 dets Exp $ */ +/* $Id: mbfilter_ru.c,v 1.5 2002/05/30 10:10:16 dets Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -74,17 +74,21 @@ { int s, n; - s = -1; - n = cp1251_ucs_table_len-1; - while (n >= 0) { - if (c == cp1251_ucs_table[n]) { - s = cp1251_ucs_table_min + n; - break; + if (c < 0x80) { + s = c; + } else { + s = -1; + n = cp1251_ucs_table_len-1; + while (n >= 0) { + if (c == cp1251_ucs_table[n]) { + s = cp1251_ucs_table_min + n; + break; + } + n--; + } + if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_CP1251) { + s = c & MBFL_WCSPLANE_MASK; } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_CP1251) { - s = c & MBFL_WCSPLANE_MASK; } if (s >= 0) { @@ -134,17 +138,21 @@ { int s, n; - s = -1; - n = cp866_ucs_table_len-1; - while (n >= 0) { - if (c == cp866_ucs_table[n]) { - s = cp866_ucs_table_min + n; - break; + if (c < 0x80) { + s = c; + } else { + s = -1; + n = cp866_ucs_table_len-1; + while (n >= 0) { + if (c == cp866_ucs_table[n]) { + s = cp866_ucs_table_min + n; + break; + } + n--; + } + if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_CP866) { + s = c & MBFL_WCSPLANE_MASK; } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_CP866) { - s = c & MBFL_WCSPLANE_MASK; } if (s >= 0) { @@ -194,17 +202,21 @@ { int s, n; - s = -1; - n = koi8r_ucs_table_len-1; - while (n >= 0) { - if (c == koi8r_ucs_table[n]) { - s = koi8r_ucs_table_min + n; - break; + if (c < 0x80) { + s = c; + } else { + s = -1; + n = koi8r_ucs_table_len-1; + while (n >= 0) { + if (c == koi8r_ucs_table[n]) { + s = koi8r_ucs_table_min + n; + break; + } + n--; + } + if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_KOI8R) { + s = c & MBFL_WCSPLANE_MASK; } - n--; - } - if (s <= 0 && (c & ~MBFL_WCSPLANE_MASK) == MBFL_WCSPLANE_KOI8R) { - s = c & MBFL_WCSPLANE_MASK; } if (s >= 0) {

« previous php.cvs (#12164) next »