From: Jon Trulson Date: Sun, 21 Sep 2014 02:00:38 +0000 (-0600) Subject: dttypes: use regex on linux too. X-Git-Tag: 2.2.3~107 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9842ee3d9670e4193ac5ebb2f38f2fd94887d425;p=oweals%2Fcde.git dttypes: use regex on linux too. --- diff --git a/cde/programs/util/dttypes/dttypes.c b/cde/programs/util/dttypes/dttypes.c index 00ce7918..e5bf4593 100644 --- a/cde/programs/util/dttypes/dttypes.c +++ b/cde/programs/util/dttypes/dttypes.c @@ -41,7 +41,7 @@ #define RETURN(c) return(c) #define ERROR(c) {rexp_errno = c; return((char *)0);} static int rexp_errno = 0; -#if defined(CSRG_BASED) +#if defined(CSRG_BASED) || defined(linux) #include #else #include @@ -158,7 +158,7 @@ rec_list(List *l) DtDtsMMField *fld_ptr; DtDtsMMField *fld_ptr_list; -#if defined(CSRG_BASED) +#if defined(CSRG_BASED) || defined(linux) regex_t regex_rn; regex_t regex_fn; regex_t regex_fv; @@ -175,7 +175,7 @@ rec_list(List *l) memset(expbuf_df, '\0', sizeof(expbuf_df)); #endif -#if defined(CSRG_BASED) +#if defined(CSRG_BASED) || defined(linux) if(regcomp(®ex_rn, l->rec_name?l->rec_name:"^.*", 0) != 0) #else if((compile(l->rec_name?l->rec_name:"^.*", @@ -189,7 +189,7 @@ rec_list(List *l) exit(1); } -#if defined(CSRG_BASED) +#if defined(CSRG_BASED) || defined(linux) if(regcomp(®ex_fn, l->fld_name?l->fld_name:"^.*", 0) != 0) #else if((compile(l->fld_name?l->fld_name:"^.*", @@ -203,7 +203,7 @@ rec_list(List *l) exit(1); } -#if defined(CSRG_BASED) +#if defined(CSRG_BASED) || defined(linux) if(regcomp(®ex_fv, l->fld_value?l->fld_value:"^.*", 0) != 0) #else if((compile(l->fld_value?l->fld_value:"^.*", @@ -217,7 +217,7 @@ rec_list(List *l) exit(1); } -#if defined(CSRG_BASED) +#if defined(CSRG_BASED) || defined(linux) if(regcomp(®ex_df, l->display_fld?l->display_fld:"^.*", 0) != 0) #else if((compile(l->display_fld?l->display_fld:"^.*", @@ -237,7 +237,7 @@ rec_list(List *l) { rec_ptr = &rec_ptr_list[rec]; fld_ptr_list = _DtDtsMMGetPtr(rec_ptr->fieldList); -#if defined(CSRG_BASED) +#if defined(CSRG_BASED) || defined(linux) if(regexec(®ex_rn, (char *)_DtDtsMMBosonToString(rec_ptr->recordName), 0, NULL, 0) == 0) @@ -255,7 +255,7 @@ rec_list(List *l) fn = _DtDtsMMExpandValue(_DtDtsMMBosonToString(fld_ptr->fieldName)); fv = _DtDtsMMExpandValue(_DtDtsMMBosonToString(fld_ptr->fieldValue)); -#if defined(CSRG_BASED) +#if defined(CSRG_BASED) || defined(linux) if((regexec(®ex_fn, fn, 0, NULL, 0) == 0) && ((fld_ptr->fieldValue==0? regexec(®ex_fv, @@ -318,7 +318,7 @@ rec_list(List *l) if(l->display_fld) { -#if defined(CSRG_BASED) +#if defined(CSRG_BASED) || defined(linux) if(regexec(®ex_df, fn, 0, NULL, 0) == 0) #else if(advance(fn, expbuf_df) !=0)