summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile15
-rw-r--r--src/ivy.c4
2 files changed, 14 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile
index cc698c9..c1f3d17 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -42,6 +42,15 @@ TCLLIB = -ltcl$(TCLVERS)
#TCLLIB = -framework Tcl
PCREINC = `pcre-config --cflags`
PCRELIB = `pcre-config --libs`
+CASESENSITIVE = "yes"
+ifeq ($(CASESENSITIVE), "no")
+ PCRE_OPT=PCRE_CASELESS
+ REGCOMP_OPT=REG_ICASE
+else
+ PCRE_OPT=0
+ REGCOMP_OPT=REG_EXTENDED
+endif
+
#PCREOBJ = `pcre-config --prefix`/lib/libpcre.a
PCREOBJ =
@@ -52,8 +61,8 @@ CC=gcc
LIBTOOL=ar q # linux and solaris
#LIBTOOL=libtool -static -o
-#REGEXP = -DGNU_REGEXP # deprecated !
-REGEXP = -DUSE_PCRE_REGEX
+#REGEXP = -DGNU_REGEXP -DREGCOMP_OPT=$(REGCOMP_OPT) # deprecated !
+REGEXP= -DUSE_PCRE_REGEX -DPCRE_OPT=$(PCRE_OPT)
# on activeTCL , set #define CHANNEL to null, and add ivyloop.o in the ivytcl target,
# see below
CHANNEL = -DTCL_CHANNEL_INTEGRATION
@@ -90,7 +99,7 @@ ivy.o: ivy.c
$(CC) -c $(CFLAGS) $(REGEXP) $(PCREINC) ivy.c
givy.o: ivy.c
- $(CC) -c $(CFLAGS) -o givy.o ivy.c
+ $(CC) -c $(CFLAGS) -DGNU_REGEXP -DREGCOMP_OPT=$(REGCOMP_OPT) -o givy.o ivy.c
ivyglutloop.o: ivyglutloop.c ivyglutloop.h
$(CC) -c $(CFLAGS) $(GLUTINC) ivyglutloop.c
diff --git a/src/ivy.c b/src/ivy.c
index 548f9f8..9f78651 100644
--- a/src/ivy.c
+++ b/src/ivy.c
@@ -376,7 +376,7 @@ static void Receive( Client client, void *data, char *line )
return;
}
#ifndef USE_PCRE_REGEX
- reg = regcomp(&regexp, arg, REG_ICASE|REG_EXTENDED);
+ reg = regcomp(&regexp, arg, REGCOMP_OPT|REG_EXTENDED);
if ( reg == 0 )
{
IVY_LIST_ADD( clnt->msg_send, snd )
@@ -395,7 +395,7 @@ static void Receive( Client client, void *data, char *line )
MsgSendTo( client, Error, reg, errbuf );
}
#else
- regexp = pcre_compile(arg, 0,&errbuf,&erroffset,NULL);
+ regexp = pcre_compile(arg, PCRE_OPT,&errbuf,&erroffset,NULL);
if ( regexp != NULL )
{
IVY_LIST_ADD( clnt->msg_send, snd )