diff options
Diffstat (limited to 'Parser/tokenizer.c')
| -rw-r--r-- | Parser/tokenizer.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 97eda75794..ad6f63ac02 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -2,13 +2,14 @@ /* XXX This is rather old, should be restructured perhaps */ /* XXX Need a better interface to report errors than writing to stderr */ +/* XXX Should use editor resource to fetch true tab size on Macintosh */ + +#include "pgenheaders.h" -#include <stdio.h> #include <ctype.h> #include "string.h" -#include "PROTO.h" -#include "malloc.h" +#include "fgetsintr.h" #include "tokenizer.h" #include "errcode.h" @@ -20,6 +21,11 @@ #define TABSIZE 8 #endif +/* Forward */ +static struct tok_state *tok_new PROTO((void)); +static int tok_nextc PROTO((struct tok_state *tok)); +static void tok_backup PROTO((struct tok_state *tok, int c)); + /* Token names */ char *tok_name[] = { @@ -352,7 +358,9 @@ tok_get(tok, p_start, p_end) This is also recognized by vi, when it occurs near the beginning or end of the file. (Will vi never die...?) */ int x; - if (sscanf(tok->cur, " vi:set tabsize=%d:", &x) == 1 && + /* XXX The case to (unsigned char *) is needed by THINK C */ + if (sscanf((unsigned char *)tok->cur, + " vi:set tabsize=%d:", &x) == 1 && x >= 1 && x <= 40) { fprintf(stderr, "# vi:set tabsize=%d:\n", x); tok->tabsize = x; |
