summaryrefslogtreecommitdiff
path: root/libguile/regex-posix.c
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2004-07-10 14:35:36 +0000
committerMarius Vollmer <mvo@zagadka.de>2004-07-10 14:35:36 +0000
commita55c2b680920198892329bdf78c92ecc7553eb58 (patch)
tree5dab8dec3f128c90a317b4a607d5d9382dfd8c85 /libguile/regex-posix.c
parent7cee5b315a702049ba869150eb3d1658d38030d0 (diff)
downloadguile-a55c2b680920198892329bdf78c92ecc7553eb58.tar.gz
* validate.h, deprecated.h (SCM_VALIDATE_INUM, SCM_VALIDATE_INUM_COPY,
SCM_VALIDATE_BIGINT, SCM_VALIDATE_INUM_MIN, SCM_VALIDATE_INUM_MIN_COPY, SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF, SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE, SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the fixnum/bignum distinction visible. Changed all uses to scm_to_size_t or similar.
Diffstat (limited to 'libguile/regex-posix.c')
-rw-r--r--libguile/regex-posix.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libguile/regex-posix.c b/libguile/regex-posix.c
index 9a128bf42..a38f440ff 100644
--- a/libguile/regex-posix.c
+++ b/libguile/regex-posix.c
@@ -230,11 +230,14 @@ SCM_DEFINE (scm_regexp_exec, "regexp-exec", 2, 2, 0,
SCM_VALIDATE_RGXP (1, rx);
SCM_VALIDATE_STRING (2, str);
- SCM_VALIDATE_INUM_DEF_COPY (3, start,0, offset);
- SCM_ASSERT_RANGE (3, start, offset >= 0 && offset <= SCM_STRING_LENGTH (str));
+
+ if (SCM_UNBNDP (start))
+ offset = 0;
+ else
+ offset = scm_to_signed_integer (start, 0, SCM_STRING_LENGTH (str));
+
if (SCM_UNBNDP (flags))
flags = SCM_INUM0;
- SCM_VALIDATE_INUM (4, flags);
/* re_nsub doesn't account for the `subexpression' representing the
whole regexp, so add 1 to nmatches. */
@@ -244,7 +247,7 @@ SCM_DEFINE (scm_regexp_exec, "regexp-exec", 2, 2, 0,
matches = scm_malloc (sizeof (regmatch_t) * nmatches);
status = regexec (SCM_RGX (rx), SCM_STRING_CHARS (str) + offset,
nmatches, matches,
- SCM_INUM (flags));
+ scm_to_int (flags));
if (!status)
{
int i;