mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-06 07:30:28 +02:00
* regex-posix.c (scm_regexp_error_msg): Change `rx' argument to
regex_t pointer. This is what the callers have, mostly. (scm_regexp_exec): Don't forget to pass the `rx' argument to scm_regexp_error_msg.
This commit is contained in:
parent
62f36a0d27
commit
435220a73c
1 changed files with 5 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -101,9 +101,7 @@ free_regex (obj)
|
||||||
SCM_SYMBOL (scm_regexp_error_key, "regular-expression-syntax");
|
SCM_SYMBOL (scm_regexp_error_key, "regular-expression-syntax");
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
scm_regexp_error_msg (regerrno, rx)
|
scm_regexp_error_msg (int regerrno, regex_t *rx)
|
||||||
int regerrno;
|
|
||||||
SCM rx;
|
|
||||||
{
|
{
|
||||||
SCM errmsg;
|
SCM errmsg;
|
||||||
int l;
|
int l;
|
||||||
|
@ -120,11 +118,11 @@ scm_regexp_error_msg (regerrno, rx)
|
||||||
|
|
||||||
errmsg = scm_make_string (SCM_MAKINUM (80), SCM_UNDEFINED);
|
errmsg = scm_make_string (SCM_MAKINUM (80), SCM_UNDEFINED);
|
||||||
SCM_DEFER_INTS;
|
SCM_DEFER_INTS;
|
||||||
l = regerror (regerrno, SCM_RGX (rx), SCM_CHARS (errmsg), 80);
|
l = regerror (regerrno, rx, SCM_CHARS (errmsg), 80);
|
||||||
if (l > 80)
|
if (l > 80)
|
||||||
{
|
{
|
||||||
errmsg = scm_make_string (SCM_MAKINUM (l), SCM_UNDEFINED);
|
errmsg = scm_make_string (SCM_MAKINUM (l), SCM_UNDEFINED);
|
||||||
regerror (regerrno, SCM_RGX (rx), SCM_CHARS (errmsg), l);
|
regerror (regerrno, rx, SCM_CHARS (errmsg), l);
|
||||||
}
|
}
|
||||||
SCM_ALLOW_INTS;
|
SCM_ALLOW_INTS;
|
||||||
return SCM_CHARS (errmsg);
|
return SCM_CHARS (errmsg);
|
||||||
|
@ -242,7 +240,7 @@ scm_regexp_exec (SCM rx, SCM str, SCM start, SCM flags)
|
||||||
if (status != 0 && status != REG_NOMATCH)
|
if (status != 0 && status != REG_NOMATCH)
|
||||||
scm_error (scm_regexp_error_key,
|
scm_error (scm_regexp_error_key,
|
||||||
s_regexp_exec,
|
s_regexp_exec,
|
||||||
scm_regexp_error_msg (status),
|
scm_regexp_error_msg (status, SCM_RGX (rx)),
|
||||||
SCM_BOOL_F,
|
SCM_BOOL_F,
|
||||||
SCM_BOOL_F);
|
SCM_BOOL_F);
|
||||||
return mvec;
|
return mvec;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue