mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 22:29:16 +02:00
Fixing string->number for (string->number "[a-f]" 16) case.
This commit is contained in:
parent
354ceb2113
commit
658f3cecd5
1 changed files with 1 additions and 1 deletions
2
sexp.c
2
sexp.c
|
@ -2865,7 +2865,7 @@ sexp sexp_string_to_number_op (sexp ctx, sexp self, sexp_sint_t n, sexp str, sex
|
||||||
if (((base=sexp_unbox_fixnum(b)) < 2) || (base > 36))
|
if (((base=sexp_unbox_fixnum(b)) < 2) || (base > 36))
|
||||||
return sexp_user_exception(ctx, self, "invalid numeric base", b);
|
return sexp_user_exception(ctx, self, "invalid numeric base", b);
|
||||||
if (sexp_string_data(str)[0]=='\0'
|
if (sexp_string_data(str)[0]=='\0'
|
||||||
|| (sexp_string_data(str)[1]=='\0' && !sexp_isdigit((unsigned char)(sexp_string_data(str)[0]))))
|
|| (sexp_string_data(str)[1]=='\0' && !sexp_isxdigit((unsigned char)(sexp_string_data(str)[0]))))
|
||||||
return SEXP_FALSE;
|
return SEXP_FALSE;
|
||||||
sexp_gc_preserve1(ctx, in);
|
sexp_gc_preserve1(ctx, in);
|
||||||
in = sexp_make_input_string_port(ctx, str);
|
in = sexp_make_input_string_port(ctx, str);
|
||||||
|
|
Loading…
Add table
Reference in a new issue