diff options
author | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2005-10-09 18:59:28 +0000 |
---|---|---|
committer | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2005-10-09 18:59:28 +0000 |
commit | e2c423a32d8ba724e19e6db5b315ef9011d89488 (patch) | |
tree | a13389bf9b8a2bd8b96a53a01aa5822ef8a85564 /src | |
parent | ea03b6bcd1045dfc0d6947e4858de8994d61170b (diff) |
Bug #3755 <https://bugs.freedesktop.org/show_bug.cgi?id=3755> twm can't
handle 8-bit characters in .twmrc (Tomohiro KUBOITA)
Diffstat (limited to 'src')
-rw-r--r-- | src/parse.c | 11 | ||||
-rw-r--r-- | src/parse.h | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/parse.c b/src/parse.c index 3f8d801..88b0b08 100644 --- a/src/parse.c +++ b/src/parse.c @@ -1,3 +1,4 @@ +/* $XdotOrg: $ */ /* $XFree86: xc/programs/twm/parse.c,v 1.15 2002/09/24 21:00:28 tsi Exp $ */ /*****************************************************************************/ /* @@ -81,10 +82,10 @@ in this Software without prior written authorization from The Open Group. static FILE *twmrc; static int ptr = 0; static int len = 0; -static char buff[BUF_LEN+1]; +static unsigned char buff[BUF_LEN+1]; static unsigned char overflowbuff[20]; /* really only need one */ static int overflowlen; -static char **stringListSource, *currentString; +static unsigned char **stringListSource, *currentString; static int doparse ( int (*ifunc)(void), char *srctypename, char *srcname ); static int twmFileInput ( void ); @@ -224,7 +225,7 @@ int ParseTwmrc (char *filename) } } -int ParseStringList (char **sl) +int ParseStringList (unsigned char **sl) { stringListSource = sl; currentString = *sl; @@ -243,11 +244,11 @@ static int twmFileInput() while (ptr == len) { - if (fgets(buff, BUF_LEN, twmrc) == NULL) + if (fgets((char *) buff, BUF_LEN, twmrc) == NULL) return 0; ptr = 0; - len = strlen(buff); + len = strlen((char *) buff); } return ((int)buff[ptr++]); } diff --git a/src/parse.h b/src/parse.h index cb63a62..1768f10 100644 --- a/src/parse.h +++ b/src/parse.h @@ -1,3 +1,4 @@ +/* $XdotOrg: $ */ /* $XFree86: xc/programs/twm/parse.h,v 1.10 2001/09/30 17:58:19 herrb Exp $ */ /*****************************************************************************/ /* @@ -76,7 +77,7 @@ extern int do_color_keyword ( int keyword, int colormode, char *s ); void put_pixel_on_root ( Pixel pixel ); extern void do_string_savecolor ( int colormode, char *s ); extern void do_var_savecolor ( int key ); -extern int ParseStringList ( char **sl ); +extern int ParseStringList ( unsigned char **sl ); extern int ParseTwmrc ( char *filename ); extern int parse_keyword ( char *s, int *nump ); extern void TwmOutput ( int c ); @@ -87,7 +88,7 @@ extern void do_squeeze_entry ( name_list **list, char *name, int justify, extern int (*twmInputFunc)(void); extern int ConstrainedMoveTime; -extern char *defTwmrc[]; +extern unsigned char *defTwmrc[]; extern int mods; #define F_NOP 0 |