Commit 67178217 authored by Simon Middleton's avatar Simon Middleton
Browse files

Fixed when SS1 or SS2 followed by a set change by disallowing...

Fixed when SS1 or SS2 followed by a set change by disallowing controlcharacters after single shifts.

Made encoding_table_ptr and encoding_n_table_entries check for null tables.
moved 'Lm' type characters from marks to letters in mkunictype.

Version 0.08. Tagged as 'Unicode-0_08'
parent 45d01bdf
/* (0.07)
/* (0.08)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.07
#define Module_MajorVersion_CMHG 0.08
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 02 Dec 1997
#define Module_Date_CMHG 08 Dec 1997
#define Module_MajorVersion "0.07"
#define Module_MajorVersion "0.08"
#define Module_MinorVersion ""
#define Module_Date "02 Dec 1997"
#define Module_Date "08 Dec 1997"
......@@ -299,12 +299,12 @@ static encoding_table enc_table_list = NULL;
UCS2 *encoding_table_ptr(encoding_table t)
{
return t->table;
return t ? t->table : NULL;
}
int encoding_n_table_entries(encoding_table t)
{
return t->n_entries;
return t ? t->n_entries : 0;
}
/* Table size is number of bytes including the length word
......
......@@ -240,6 +240,8 @@ static int iso2022_select_set(ISO2022_Encoding *i, int setno, int type, int id)
encoding_table t;
ISO2022_Set *set;
/* fdebugf(stderr, "iso2022_select_set: enc %p setno %d type %d\n", i, setno, type); */
/* This can return NULL if the table is not present in which case
we fall back on default mapping functions below */
t = iso2022_find_table(type, id);
......@@ -272,6 +274,8 @@ static int iso2022_select_set(ISO2022_Encoding *i, int setno, int type, int id)
((simple_set *)set)->table = t;
/* fdebugf(stderr, "iso2022_select_set: free %p new %p tempset %d oldset %p\n", i->Set[setno], set, i->tempset, i->oldset); */
encoding__free(i->Set[setno]);
i->Set[setno] = set;
......@@ -484,8 +488,18 @@ static unsigned int iso2022_read(EncodingPriv *e,
char c = *s++;
UCS4 u;
if (i->esc_pending)
/* fdebugf(stderr, "iso2022: %02x\n", c); */
/* check for illegal single shifts */
if ((i->tempset == 1 && (c < 0x20 || c > 0x7F)) ||
(i->tempset == 2 && (c < 0xA0)))
{
u = 0xFFFD;
}
else if (i->esc_pending)
{
u = iso2022_esc_cont(i, c);
}
else if (c < 0x20)
{
i->sync[_GL] = i->sync[_GR] = 0;
......@@ -504,13 +518,7 @@ static unsigned int iso2022_read(EncodingPriv *e,
else
{
i->sync[_GL] = 0;
#ifdef DEBUG
/* fprintf(stderr, "c: %02x GR %p next_code %p\n", c, i->GR, i->GR->next_code); */
#endif
u = i->GR->next_code(i->GR, c - 0xA0, _GR, i->sync + _GR);
#ifdef DEBUG
/* fprintf(stderr, "u: %04x\n", u); */
#endif
}
switch (u)
......
......@@ -123,7 +123,6 @@ static int category_to_type(int category)
{
case cat('M', 'n'):
case cat('M', 'c'):
case cat('L', 'm'):
return unictype_MARK;
case cat('N', 'd'):
......@@ -144,6 +143,7 @@ static int category_to_type(int category)
case cat('L', 'l'):
case cat('L', 't'):
case cat('L', 'o'):
case cat('L', 'm'): /* SJM: this is a spacing character not a mark */
return unictype_LETTER;
case cat('P', 'd'):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment