mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 16:00:22 +02:00
(scm_make_regexp): Use SCM_VALIDATE_INT_COPY on flag
arguments, previously type was not checked.
This commit is contained in:
parent
858d2470d3
commit
df081058b9
1 changed files with 7 additions and 3 deletions
|
@ -184,7 +184,7 @@ SCM_DEFINE (scm_make_regexp, "make-regexp", 1, 0, 1,
|
|||
{
|
||||
SCM flag;
|
||||
regex_t *rx;
|
||||
int status, cflags;
|
||||
int status, cflags, argnum;
|
||||
|
||||
SCM_VALIDATE_STRING (1, pat);
|
||||
SCM_VALIDATE_REST_ARGUMENT (flags);
|
||||
|
@ -194,13 +194,17 @@ SCM_DEFINE (scm_make_regexp, "make-regexp", 1, 0, 1,
|
|||
turn off REG_EXTENDED flag (on by default). */
|
||||
cflags = REG_EXTENDED;
|
||||
flag = flags;
|
||||
argnum = 2;
|
||||
while (!SCM_NULLP (flag))
|
||||
{
|
||||
if (SCM_INUM (SCM_CAR (flag)) == REG_BASIC)
|
||||
int f;
|
||||
SCM_VALIDATE_INT_COPY (argnum, SCM_CAR (flag), f);
|
||||
if (f == REG_BASIC)
|
||||
cflags &= ~REG_EXTENDED;
|
||||
else
|
||||
cflags |= SCM_INUM (SCM_CAR (flag));
|
||||
cflags |= f;
|
||||
flag = SCM_CDR (flag);
|
||||
argnum++;
|
||||
}
|
||||
|
||||
rx = SCM_MUST_MALLOC_TYPE (regex_t);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue