GNU bug report logs - #7227
re-search-forward goes infinite loop with dash inside []

Previous Next

Package: emacs;

Reported by: Jari Aalto <jari.aalto <at> cante.net>

Date: Sat, 16 Oct 2010 09:13:02 UTC

Severity: normal

Found in version 23.2+1-4

Done: Jari Aalto <jari.aalto <at> cante.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jari Aalto <jari.aalto <at> cante.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#7227: closed (re-search-forward goes infinite loop with dash
 inside [])
Date: Fri, 22 Oct 2010 07:52:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 22 Oct 2010 10:55:43 +0300
with message-id <8762wu1x1c.fsf <at> picasso.cante.net>
and subject line Bug#7227 Close bts:gnu
has caused the GNU bug report #7227,
regarding re-search-forward goes infinite loop with dash inside []
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
7227: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7227
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jari Aalto <jari.aalto <at> cante.net>
To: submit <at> debbugs.gnu.org
Subject: re-search-forward goes infinite loop with dash inside []
Date: Sat, 16 Oct 2010 12:16:01 +0300
Package: emacs
Version: 23.2+1-4
Severity: normal

Executing the following code causes Emacs to go into infinite loop.
Simply run it behind the last paren with C-x C-e

(re-search-forward "^\\([a-z0-9.-]+\\)+[ \t]+\\([0-9]+\\) +\\([a-z].*\\)")
                        ==========

If the dash is taken awy from the "[a-z0-9.-]", this code does not cause
infinite loop:

(re-search-forward "^\\([a-z0-9.]+\\)+[ \t]+\\([0-9]+\\) +\\([a-z].*\\)")

TEST ROWS FOR THE REGEXPS:

row-one 1234 rest of line

row2    1234 rest of line

TEST SETUP

emacs -Q --no-site-file
<copy the re-search-forward lisp statements into buffer>
<copy the test rows into buffer>
<Execute lisp statements>

-- System Information
Debian Release: squeeze/sid
  APT Prefers testing
  APT policy: (990, testing) (500, unstable) (1, experimental)
Architecture: amd64
Kernel: Linux picasso 2.6.32-5-amd64 #1 SMP Fri Sep 17 21:50:19 UTC 2010 x86_64 GNU/Linux
Locale: LANG=en_DK.UTF-8

-- Versions of packages `emacs depends on'.
Depends:
emacs23         23.2+1-4        GNU Emacs is the extensible self-documenting
emacs23-lucid   23.2+1-4        GNU Emacs is the extensible self-documenting
emacs23-nox     23.2+1-4        GNU Emacs is the extensible self-documenting


[Message part 3 (message/rfc822, inline)]
From: Jari Aalto <jari.aalto <at> cante.net>
To: 7227-done <at> debbugs.gnu.org
Subject: Bug#7227 Close bts:gnu
Date: Fri, 22 Oct 2010 10:55:43 +0300
Reason for close:

Not a bug. In non-matching case, the regexp engine pumps up; thus "Loop
effect" feel.


This bug report was last modified 14 years and 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.