[444] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[D-O-H] r574 - in trunk: . owl

daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:06:13 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
Date: Mon, 29 Jan 2007 22:37:47 -0500
To: dirty-owl-hackers@mit.edu
From: nelhage@MIT.EDU
Reply-To: dirty-owl-hackers@MIT.EDU

Author: nelhage
Date: 2007-01-29 22:37:47 -0500 (Mon, 29 Jan 2007)
New Revision: 574

Modified:
   trunk/
   trunk/owl/functions.c
Log:
 r18208@phanatique:  nelhage | 2007-01-29 22:37:41 -0500
 Fixing the smartnarrow bug on instances with lots of periods or other
 RE metacharacters.



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - bb873fd7-8e23-0410-944a-99ec44c633eb:/branches/owl/filter-rewrite:15925
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h/trunk:18206
   + bb873fd7-8e23-0410-944a-99ec44c633eb:/branches/owl/filter-rewrite:15925
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h/trunk:18208

Modified: trunk/owl/functions.c
===================================================================
--- trunk/owl/functions.c	2007-01-30 02:54:41 UTC (rev 573)
+++ trunk/owl/functions.c	2007-01-30 03:37:47 UTC (rev 574)
@@ -2640,14 +2640,17 @@
   }
 
   /* create the new filter */
-  argbuff=owl_malloc(len+20);
   tmpclass=owl_text_quote(class, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
   owl_text_tr(tmpclass, ' ', '.');
   if (instance) {
     tmpinstance=owl_text_quote(instance, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
     owl_text_tr(tmpinstance, ' ', '.');
   }
-  sprintf(argbuff, "( class ^(un)*%s(\\.d)*$ )", tmpclass);
+  len = strlen(tmpclass);
+  if(tmpinstance) len += strlen(tmpinstance);
+  len += 60;
+  argbuff = owl_malloc(len);
+  sprintf(argbuff, "class ^(un)*%s(\\.d)*$", tmpclass);
   if (tmpinstance) {
     sprintf(argbuff, "%s and ( instance ^%s(\\.d)*$ )", argbuff, tmpinstance);
   }


home help back first fref pref prev next nref lref last post