summaryrefslogtreecommitdiff
path: root/pico
diff options
context:
space:
mode:
Diffstat (limited to 'pico')
-rw-r--r--pico/estruct.h2
-rw-r--r--pico/osdep/mswin_spell.c19
2 files changed, 17 insertions, 4 deletions
diff --git a/pico/estruct.h b/pico/estruct.h
index f0090881..410dfc02 100644
--- a/pico/estruct.h
+++ b/pico/estruct.h
@@ -238,7 +238,7 @@ typedef struct {
*/
typedef struct CELL {
unsigned int c : 24; /* Character value in cell */
- unsigned int a : 8; /* Its attributes */
+ unsigned int a : 7; /* Its attributes */
unsigned int d : 1; /* direction */
} CELL;
diff --git a/pico/osdep/mswin_spell.c b/pico/osdep/mswin_spell.c
index e921cfcd..ac899421 100644
--- a/pico/osdep/mswin_spell.c
+++ b/pico/osdep/mswin_spell.c
@@ -437,6 +437,9 @@ spell_dlg_proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
static int
get_next_word(WORD_INFO *word_info)
{
+ UCS *ucst;
+ int i, hibit;
+
// Skip quoted lines
while(lgetc(curwp->w_dotp, 0).c == '>')
{
@@ -479,9 +482,19 @@ get_next_word(WORD_INFO *word_info)
break;
}
- word_info->word_utf8 = ucs4_to_utf8_cpystr_n(
- (UCS *)&word_info->word_dotp->l_text[word_info->word_doto],
- word_info->word_size);
+ ucst = (UCS *)&word_info->word_dotp->l_text[word_info->word_doto];
+ for(i = 0, hibit = 0; i < word_info->word_size; i++)
+ if(ucst[i] & 0xff000000)
+ hibit++;
+
+ if(hibit > 0){
+ ucst = ucs4_cpystr(ucst);
+ for(i = 0; i < word_info->word_size; i++)
+ ucst[i] &= 0xffffff;
+ }
+ word_info->word_utf8 = ucs4_to_utf8_cpystr_n(ucst, word_info->word_size);
+ if(hibit > 0)
+ fs_give((void **)&ucst);
return 1;
}