-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
SCM_SYMBOL (scm_regexp_error_key, "regular-expression-syntax");
-char *
+static char *
scm_regexp_error_msg (regerrno, rx)
int regerrno;
SCM rx;
{
SCM_ASSERT (SCM_INUMP (start), start, SCM_ARG3, s_regexp_exec);
offset = SCM_INUM (start);
- SCM_ASSERT (offset >= 0 && offset <= SCM_LENGTH (str), start,
+ SCM_ASSERT (offset >= 0 && (unsigned) offset <= SCM_LENGTH (str), start,
SCM_OUTOFRANGE, s_regexp_exec);
}
mvec = scm_make_vector (SCM_MAKINUM (nmatches + 1), SCM_UNSPECIFIED);
SCM_VELTS(mvec)[0] = str;
for (i = 0; i < nmatches; ++i)
- SCM_VELTS(mvec)[i+1] = scm_cons(SCM_MAKINUM(matches[i].rm_so + offset),
- SCM_MAKINUM(matches[i].rm_eo + offset));
+ if (matches[i].rm_so == -1)
+ 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_must_free ((char *) matches);
SCM_ALLOW_INTS;