From 830f3231668b78b3095d0690eb6aefd57887da2f Mon Sep 17 00:00:00 2001 From: mainzelm Date: Thu, 19 Oct 2000 08:22:37 +0000 Subject: [PATCH] Replaced error with warn. The problem itself remains. --- scsh/rx/re-low.c | 20 ++++++++++++++++---- scsh/rx/re-low.scm | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/scsh/rx/re-low.c b/scsh/rx/re-low.c index 9fe116c..4f58bee 100644 --- a/scsh/rx/re-low.c +++ b/scsh/rx/re-low.c @@ -15,39 +15,51 @@ step 4 s48_value df_compile_re(s48_value g1, s48_value g2, s48_value mv_vec) { extern int compile_re(s48_value , int , regex_t* *); - s48_value ret1; + s48_value ret1 = S48_FALSE; + S48_DECLARE_GC_PROTECT(2); int r1; - regex_t* r2; + regex_t* r2 = 0; + + S48_GC_PROTECT_2(mv_vec,ret1); r1 = compile_re(g1, EXTRACT_BOOLEAN(g2), &r2); ret1 = s48_enter_integer(r1); SetAlienVal(S48_VECTOR_REF(mv_vec,0),(long) r2);//simple-assign + S48_GC_UNPROTECT(); return ret1; } s48_value df_re_search(s48_value g1, s48_value g2, s48_value g3, s48_value g4, s48_value g5, s48_value g6, s48_value g7) { extern s48_value re_search(const regex_t *, s48_value , int , s48_value , int , s48_value , s48_value ); - s48_value ret1; + s48_value ret1 = S48_FALSE; + S48_DECLARE_GC_PROTECT(1); s48_value r1; + + S48_GC_PROTECT_1(ret1); r1 = re_search((const regex_t *)AlienVal(g1), g2, s48_extract_integer(g3), g4, s48_extract_integer(g5), g6, g7); ret1 = r1; + S48_GC_UNPROTECT(); return ret1; } s48_value df_re_errint2str(s48_value g1, s48_value g2, s48_value mv_vec) { extern const char *re_errint2str(int , const regex_t *); - s48_value ret1; + s48_value ret1 = S48_FALSE; + S48_DECLARE_GC_PROTECT(2); const char *r1; + + S48_GC_PROTECT_2(mv_vec,ret1); r1 = re_errint2str(s48_extract_integer(g1), (const regex_t *)AlienVal(g2)); ret1 = S48_VECTOR_REF(mv_vec,0); SetAlienVal(S48_CAR(ret1),(long) r1); S48_SET_CDR(ret1,strlen_or_false(r1));//str-and-len + S48_GC_UNPROTECT(); return ret1; } diff --git a/scsh/rx/re-low.scm b/scsh/rx/re-low.scm index 5f7c780..6b3e4cd 100644 --- a/scsh/rx/re-low.scm +++ b/scsh/rx/re-low.scm @@ -148,12 +148,12 @@ (define (free-bytes the-cre) (if (cre:bytes the-cre) (%free-re (cre:bytes the-cre)) - (error "free-bytes called on #f"))) + (warn "free-bytes called on #f"))) (define (free-bytes/nm the-cre) (if (cre:bytes the-cre) (%free-re (cre:bytes/nm the-cre)) - (error "free-bytes called on #f"))) + (warn "free-bytes/nm called on #f"))) (define (register-re-c-struct:bytes cre) (add-finalizer! cre free-bytes))