[uim-commit] r2295 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Wed Nov 30 21:39:10 PST 2005
Author: yamaken
Date: 2005-11-30 21:39:04 -0800 (Wed, 30 Nov 2005)
New Revision: 2295
Modified:
branches/r5rs/sigscheme/read.c
Log:
* sigscheme/read.c
- (parse_unicode_sequence): Add arg 'len'
- (read_unicode_sequence, read_char): Follow the change
Modified: branches/r5rs/sigscheme/read.c
===================================================================
--- branches/r5rs/sigscheme/read.c 2005-12-01 05:32:37 UTC (rev 2294)
+++ branches/r5rs/sigscheme/read.c 2005-12-01 05:39:04 UTC (rev 2295)
@@ -105,7 +105,7 @@
static size_t read_token(ScmObj port,
char *buf, size_t buf_size, const char *delim);
#if SCM_USE_SRFI75
-static int parse_unicode_sequence(const char *seq);
+static int parse_unicode_sequence(const char *seq, int len);
static int read_unicode_sequence(ScmObj port, char prefix);
#endif
@@ -359,14 +359,11 @@
}
#if SCM_USE_SRFI75
-static int parse_unicode_sequence(const char *seq)
+static int parse_unicode_sequence(const char *seq, int len)
{
int c;
- size_t len;
char *first_nondigit;
- len = strlen(seq);
-
/* reject ordinary char literal and invalid signed hexadecimal */
if (len < 3 || !isxdigit(seq[1]))
return -1;
@@ -412,7 +409,7 @@
}
seq[0] = prefix;
read_sequence(port, &seq[1], len);
- return parse_unicode_sequence(seq);
+ return parse_unicode_sequence(seq, len + sizeof(prefix));
}
#endif /* SCM_USE_SRFI75 */
@@ -441,7 +438,7 @@
CDBG((SCM_DBG_PARSER, "read_char : ch = %s", buf));
#if SCM_USE_SRFI75
- unicode = parse_unicode_sequence(buf);
+ unicode = parse_unicode_sequence(buf, len + 1);
if (0 <= unicode)
return Scm_NewChar(unicode);
#endif
More information about the uim-commit
mailing list