2002-01-28 Stefan Jahn <stefan@lkcc.org>
[bpt/guile.git] / libguile / regex-posix.c
index 71cb3b0..3d1ef56 100644 (file)
@@ -40,8 +40,6 @@
  * If you do not wish that, delete this exception notice.
  */
 
-/* Software engineering face-lift by Greg J. Badros, 11-Dec-1999,
-   gjb@cs.washington.edu, http://www.cs.washington.edu/homes/gjb */
 
 \f
 
@@ -190,7 +188,6 @@ SCM_DEFINE (scm_make_regexp, "make-regexp", 1, 0, 1,
 
   SCM_VALIDATE_STRING (1, pat);
   SCM_VALIDATE_REST_ARGUMENT (flags);
-  SCM_STRING_COERCE_0TERMINATION_X (pat);
 
   /* Examine list of regexp flags.  If REG_BASIC is supplied, then
      turn off REG_EXTENDED flag (on by default). */
@@ -257,7 +254,6 @@ SCM_DEFINE (scm_regexp_exec, "regexp-exec", 2, 2, 0,
   if (SCM_UNBNDP (flags))
     flags = SCM_INUM0;
   SCM_VALIDATE_INUM (4,flags);
-  SCM_STRING_COERCE_0TERMINATION_X (str);
 
   /* re_nsub doesn't account for the `subexpression' representing the
      whole regexp, so add 1 to nmatches. */
@@ -280,8 +276,8 @@ SCM_DEFINE (scm_regexp_exec, "regexp-exec", 2, 2, 0,
          SCM_VELTS(mvec)[i+1] = scm_cons (SCM_MAKINUM (-1), SCM_MAKINUM (-1));
        else
          SCM_VELTS(mvec)[i+1]
-           = scm_cons(SCM_MAKINUM(matches[i].rm_so + offset),
-                      SCM_MAKINUM(matches[i].rm_eo + offset));
+           = scm_cons (scm_long2num (matches[i].rm_so + offset),
+                       scm_long2num (matches[i].rm_eo + offset));
     }
   scm_must_free ((char *) matches);
   SCM_ALLOW_INTS;