packages: setedit/setedit-pcre_fullinfo.patch (NEW)=?UTF-8?Q?=20?=- compilation fix for p...

witekfl witekfl at pld-linux.org
Wed Mar 28 14:29:58 CEST 2012


Author: witekfl                      Date: Wed Mar 28 12:29:58 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- compilation fix for pcre-8.30

---- Files affected:
packages/setedit:
   setedit-pcre_fullinfo.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/setedit/setedit-pcre_fullinfo.patch
diff -u /dev/null packages/setedit/setedit-pcre_fullinfo.patch:1.1
--- /dev/null	Wed Mar 28 14:29:58 2012
+++ packages/setedit/setedit-pcre_fullinfo.patch	Wed Mar 28 14:29:53 2012
@@ -0,0 +1,73 @@
+diff -Nru setedit.old/config.pl setedit/config.pl
+--- setedit.old/config.pl	2007-06-13 14:50:11.000000000 +0200
++++ setedit/config.pl	2012-03-28 14:04:13.000000000 +0200
+@@ -901,7 +901,9 @@
+  int   errorOffset,hits,max,*matchs;
+  compiled=pcre_compile("test",flags,&error,&errorOffset,0);
+  if (!compiled) return 1;
+- max=(pcre_info(compiled,0,0)+1)*3;
++ pcre_fullinfo(compiled, NULL, PCRE_INFO_CAPTURECOUNT, &max);
++ ++max;
++ max *= 3;
+  matchs=(int *)malloc(max*sizeof(int));
+  hits=pcre_exec(compiled,0,"This is just a test 123",23,';
+  $t2='0,matchs,max);
+diff -Nru setedit.old/install/install.cc setedit/install/install.cc
+--- setedit.old/install/install.cc	2007-04-27 14:51:52.000000000 +0200
++++ setedit/install/install.cc	2012-03-28 14:08:34.000000000 +0200
+@@ -1214,7 +1214,9 @@
+  const char *error;
+  int   errorOffset;
+  CompiledPCRE=pcre_compile(match,PCRE_MULTILINE | PCRE_CASELESS,&error,&errorOffset,0);
+- PCREMaxMatchs=(pcre_info(CompiledPCRE,0,0)+1)*3;
++ pcre_fullinfo(CompiledPCRE, NULL, PCRE_INFO_CAPTURECOUNT, &PCREMaxMatchs);
++ ++PCREMaxMatchs;
++ PCREMaxMatchs *= 3;
+  PCREMatchs=new int[PCREMaxMatchs];
+ }
+ 
+diff -Nru setedit.old/mainsrc/loadshl.cc setedit/mainsrc/loadshl.cc
+--- setedit.old/mainsrc/loadshl.cc	2010-07-13 21:15:28.000000000 +0200
++++ setedit/mainsrc/loadshl.cc	2012-03-28 14:10:11.000000000 +0200
+@@ -1395,7 +1395,11 @@
+  if (!ret)
+     return NULL;
+ 
+- int matchs=(pcre_info(ret,0,0)+1)*3;
++ int matchs=0;
++ pcre_fullinfo(ret, NULL, PCRE_INFO_CAPTURECOUNT, &matchs);
++ ++matchs;
++ matchs *= 3;
++
+  if (matchs>p.PCREMaxMatchs)
+     p.PCREMaxMatchs=matchs;
+ 
+diff -Nru setedit.old/mainsrc/search.cc setedit/mainsrc/search.cc
+--- setedit.old/mainsrc/search.cc	2004-12-01 16:33:44.000000000 +0100
++++ setedit/mainsrc/search.cc	2012-03-28 14:08:46.000000000 +0200
+@@ -461,7 +461,9 @@
+ 
+  // For PCRE 2.x this value should be enlarged to left space needed by
+  // pcre_exec 
+- PCREMaxMatchs=(pcre_info(CompiledPCRE,0,0)+1)*3;
++ pcre_fullinfo(CompiledPCRE, NULL, PCRE_INFO_CAPTURECOUNT, &PCREMaxMatchs);
++ ++PCREMaxMatchs;
++ PCREMaxMatchs *= 3;
+  PCREMatchs=new int[PCREMaxMatchs];
+ 
+  if (!PCREMatchs)
+diff -Nru setedit.old/setedit/loadcle.cc setedit/setedit/loadcle.cc
+--- setedit.old/setedit/loadcle.cc	2005-08-08 18:48:16.000000000 +0200
++++ setedit/setedit/loadcle.cc	2012-03-28 14:11:29.000000000 +0200
+@@ -332,8 +332,9 @@
+     subX=0;
+     return 0;
+    }
+-
+- subX=(pcre_info(ret,0,0)+1)*3;
++ pcre_fullinfo(ret, NULL, PCRE_INFO_CAPTURECOUNT, &subX);
++ ++subX;
++ subX *= 3;
+  return ret;
+ }
+ 
================================================================


More information about the pld-cvs-commit mailing list