Commit 69bc6393 authored by Sergei Golovan's avatar Sergei Golovan Committed by Sergei Golovan

* Added patch by upstream (proposed by Per Cederqvist) which fixes

    slow processing of certain regexp patterns by preventing their
    convertation to glob patterns (closes: #591695).
  * Don't load Expect package to tclsh 8.4 because it causes a
    segmentation fault.
  * Updated package to standards version 3.9.1 (no changes needed).
parent 08d5619c
expect (5.44.1.15-3) UNRELEASED; urgency=low
expect (5.44.1.15-3) unstable; urgency=low
* NOT RELEASED YET
* Added patch by upstream (proposed by Per Cederqvist) which fixes
slow processing of certain regexp patterns by preventing their
convertation to glob patterns (closes: #591695).
* Don't load Expect package to tclsh 8.4 because it causes a
segmentation fault.
* Updated package to standards version 3.9.1 (no changes needed).
-- Sergei Golovan <sgolovan@debian.org> Thu, 15 Jul 2010 18:48:08 +0400
-- Sergei Golovan <sgolovan@debian.org> Sun, 05 Sep 2010 09:48:27 +0400
expect (5.44.1.15-2) unstable; urgency=low
......
......@@ -5,7 +5,7 @@ Maintainer: Sergei Golovan <sgolovan@debian.org>
Build-Depends: debhelper (>= 7.0.50~), quilt (>=0.46-7), autotools-dev, autoconf,
tcl8.5-dev, tk8.5-dev (>= 8.5.7-2)
Build-Conflicts: autoconf2.13
Standards-Version: 3.9.0
Standards-Version: 3.9.1
Homepage: http://sourceforge.net/projects/expect/
Package: expect
......
......@@ -8,21 +8,27 @@ Last-Modified: 2009-11-18
--- expect-5.44.1.15.orig/Makefile.in
+++ expect-5.44.1.15/Makefile.in
@@ -331,7 +331,7 @@
@@ -330,8 +330,10 @@
( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH)
pkgIndex.tcl-hand:
(echo 'package ifneeded Expect $(PACKAGE_VERSION) \
- (echo 'package ifneeded Expect $(PACKAGE_VERSION) \
- [list load [file join $$dir $(PKG_LIB_FILE)]]'\
+ (echo 'if {[package vcompare [info tclversion] @TCL_VERSION@] < 0} return' ; \
+ echo '' ; \
+ echo 'package ifneeded Expect $(PACKAGE_VERSION) \
+ [list load [file join @prefix@ lib libexpect.so.@PACKAGE_VERSION@]]'\
) > pkgIndex.tcl
#========================================================================
--- expect-5.44.1.15.orig/pkgIndex.in
+++ expect-5.44.1.15/pkgIndex.in
@@ -7,4 +7,4 @@
@@ -7,4 +7,6 @@
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.
+if {[package vcompare [info tclversion] @TCL_VERSION@] < 0} return
+
-package ifneeded Expect @EXP_VERSION_FULL@ [list load [file join $dir .. @EXP_SHARED_LIB_FILE@]]
+package ifneeded Expect @EXP_VERSION_FULL@ [list load [file join @prefix@ lib libexpect.so.@PACKAGE_VERSION@]]
--- expect-5.44.1.15.orig/tests/cat.test
......
Author: Upstream (proposed by Per Cederqvist <ceder@lysator.liu.se>)
Description: The patch fixes regression with very slow regexp pattern
processing which were converted into too complex glob patterns.
The regression was added in version 5.44.
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591695
Bug-Upstream: http://sourceforge.net/tracker/?func=detail&atid=113179&aid=3010684&group_id=13179
Forwarded: no
Last-updated: Sun, 05 Sep 2010 09:35:03 +0400
--- expect-5.44.1.15.orig/retoglob.c
+++ expect-5.44.1.15/retoglob.c
@@ -34,6 +34,10 @@
Tcl_UniChar* str,
int strlen));
+static int
+ExpCountStar _ANSI_ARGS_ ((Tcl_UniChar* src, Tcl_UniChar* last));
+
+
static char*
xxx (Tcl_UniChar* x, int xl)
{
@@ -465,6 +469,15 @@
LOG (stderr,"ST '%s'\n",xxx(out,nexto-out)); FF;
/*
+ * Heuristic: if there are more than two *s, the risk is far too
+ * large that the result actually is slower than the normal re
+ * matching. So bail out.
+ */
+ if (ExpCountStar (out,nexto) > 2) {
+ goto error;
+ }
+
+ /*
* Check if the result is actually useful.
* Empty or just a *, or ? are not. A series
* of ?'s is borderline, as they semi-count
@@ -717,6 +730,31 @@
return dst;
}
+static int
+ExpCountStar (src, last)
+ Tcl_UniChar* src;
+ Tcl_UniChar* last;
+{
+ int skip = 0;
+ int stars = 0;
+
+ /* Count number of *'s. State machine. The complexity is due to the
+ * need of handling escaped characters.
+ */
+
+ for (; src < last; src++) {
+ if (skip) {
+ skip = 0;
+ } else if (*src == '\\') {
+ skip = 1;
+ } else if (*src == '*') {
+ stars++;
+ }
+ }
+
+ return stars;
+}
+
#undef CHOP
#undef CHOPC
#undef EMIT
......@@ -14,3 +14,4 @@
17-norc.patch
18-non-linux.patch
19-tk-init.patch
20-two-asterisks.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment