aboutsummaryrefslogtreecommitdiffstats
path: root/rgx.c
diff options
context:
space:
mode:
authorDavid N. Welton <davidw@efn.org>1998-12-11 20:21:49 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:25 -0800
commita47af30d2f0e96afcd1f14b1984575c359faa3d6 (patch)
tree2ed08ce2d757f917de7c3c7c04fd7e309f454c83 /rgx.c
parentf64b2806c1d66a1341bb8b1491f384169ab1d65f (diff)
parentdb04688faa20f3576257c0fe41752ec435beab9a (diff)
downloadscm-a47af30d2f0e96afcd1f14b1984575c359faa3d6.tar.gz
scm-a47af30d2f0e96afcd1f14b1984575c359faa3d6.zip
Import Debian changes 5c3-5debian/5c3-5
scm (5c3-5) frozen unstable; urgency=low * debian/rules chmod +x's bld.scm. Fixes #30521. scm (5c3-4) frozen unstable; urgency=low * Made bld.scm executable. Fixes #29578. scm (5c3-3) frozen unstable; urgency=low * -nw * Fixes #16762. * Fixes #18163. * Fixes #18164. * Fixes #23743. * Fixes #24098. * Fixes #24099. * Fixes #24547. scm (5c3-2) frozen unstable; urgency=low * Re-uploading for slink freeze. scm (5c3-1) unstable; urgency=low * New upstream version.
Diffstat (limited to 'rgx.c')
-rw-r--r--rgx.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/rgx.c b/rgx.c
index 974116a..1006cf8 100644
--- a/rgx.c
+++ b/rgx.c
@@ -51,7 +51,7 @@
#endif
static char rcsid[] =
- "$Id: rgx.c, v 1.20 1995/02/15 04:39:45 dpb Exp $";
+ "$Id: rgx.c,v 1.4 1998/09/11 18:13:43 radey Exp $";
#ifdef HAVE_ALLOCA
# include <alloca.h>
@@ -131,7 +131,7 @@ int prinregex(exp, port, writing)
SCM exp; SCM port; int writing;
{
lputs("#<regex ", port);
- intprint(CDR(exp), 16, port);
+ intprint(CDR(exp), -16, port);
lputc(' ', port);
iprin1(RGX_PATTERN(exp), port, writing);
lputc('>', port);
@@ -192,9 +192,10 @@ SCM lregcomp(pattern, flags)
ASSERT(NIMP(pattern) && STRINGP(pattern), pattern, ARG1, s_regcomp);
ASSERT(UNBNDP(flags) || (NIMP(flags) && STRINGP(flags)),
flags, ARG2, s_regcomp);
- NEWCELL(z);
DEFER_INTS;
- SETCHARS(z, info=(regex_info*)must_malloc((long)sizeof(regex_info), s_regex));
+ z = must_malloc_cell((long)sizeof(regex_info), s_regex);
+ scm_protect_temp(&z);
+ info=(regex_info*)CHARS(z);
prog = &(info->rgx);
CAR(z) = tc16_rgx;
#ifdef __REGEXP_LIBRARY_H__
@@ -250,12 +251,19 @@ SCM lregcomp(pattern, flags)
DEFER_INTS;
if (fastmap)
prog->fastmap = must_malloc(CHAR_SET_SIZE, s_regex);
+ else
+ prog->fastmap = NULL;
if (ignore_case) {
prog->translate = must_malloc(CHAR_SET_SIZE, s_regex);
for (i = 0; i < CHAR_SET_SIZE; i++)
prog->translate[i] = ISUPPER (i) ? tolower (i) : i;
}
+ else
+ prog->translate = NULL;
+
+ prog->buffer = NULL;
+ prog->allocated = 0;
re_set_syntax(options);
err_msg = (char *)re_compile_pattern(CHARS(pattern), LENGTH(pattern), prog);