Your message dated Sat, 26 Jul 2008 11:47:20 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#487611: fixed in mc 2:4.6.2~git20080311-3
has caused the Debian Bug report #487611,
regarding Fixes for mcedit regexp replace
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)


-- 
487611: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=487611
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: mc
Version: 4.6.2~git20080311-1
Severity: wishlist

Hi,
Here is next round of patches fixing mcedit's regexp replace,
please include them in next version:

99a_fix-regex-bol-match.patch fixes matching beginning of line,
previously bol was matched at cursor after starting regexp replace.

99b_fix-regex-pattern-lengths.patch fixes subpattern byte offset
computation, previously mbstrlen function (which chokes on
nonprinting characters) was used and regex substrings that captured
for example tab characters were incorrectly truncated.

99c_fix-regex-newline-match.patch removes multiline matching -
make regexp less suprising because it is usually assumed that '.'
does not match newline. Function edit_find_string already splits
data on newlines before passing it to string_regexp_search,
so multiline matching is already crippled.

I also responded to bugreport http://bugs.debian.org/486676
with corrected patch for previous issues.

Regards,
Michal Pokrywka
Fix regexp matching beginning of line, bol was matched at cursor after
starting regexp replace.

--- mc-4.6.2~git20080311/edit/editcmd.c.orig	2008-06-22 16:58:16.000000000 +0200
+++ mc-4.6.2~git20080311/edit/editcmd.c	2008-06-22 16:58:53.000000000 +0200
@@ -1721,7 +1721,7 @@
 	    int found_start, match_bol, move_win = 0;
 
 	    while (start + offset < last_byte) {
-		match_bol = (offset == 0 || (*get_byte) (data, start + offset - 1) == '\n');
+		match_bol = (start == 0 || (*get_byte) (data, start + offset - 1) == '\n');
 		if (!move_win) {
 		    p = start + offset;
 		    q = 0;
Fix subpattern byte offsets computation, previously mbstrlen function was used
which chokes on nonprinting characters, regex substrings that captured tab
characters were truncated.

--- mc-4.6.2~git20080311/edit/editcmd.c.orig	2008-06-23 01:48:03.000000000 +0200
+++ mc-4.6.2~git20080311/edit/editcmd.c	2008-06-23 01:58:32.000000000 +0200
@@ -1511,6 +1511,32 @@
 		     sargs[argord[8]], sargs[argord[9]], sargs[argord[10]], sargs[argord[11]], \
 		     sargs[argord[12]], sargs[argord[13]], sargs[argord[14]], sargs[argord[15]]
 
+#ifdef UTF8
+size_t
+real_mbstrlen (const char *str)
+{
+    if (SLsmg_Is_Unicode) {
+        size_t width = 0;
+
+        for (; *str; str++) {
+            wchar_t c;
+            size_t len;
+
+            len = mbrtowc (&c, str, MB_CUR_MAX, NULL);
+	    
+            if (len == (size_t)(-1) || len == (size_t)(-2)) break;
+	    
+            if (len > 0) {
+                width ++;
+                str += len-1;
+            }
+        }
+
+        return width;
+    } else
+	return strlen (str);
+}
+#endif
 
 /* This function is a modification of mc-3.2.10/src/view.c:regexp_view_search() */
 /* returns -3 on error in pattern, -1 on not found, found_len = 0 if either */
@@ -1581,7 +1607,7 @@
 	    continue;
 	tmp = string[pmatch[i].rm_so];
 	string[pmatch[i].rm_so] = 0;
-	new_o = mbstrlen(string);
+	new_o = real_mbstrlen(string);
 	string[pmatch[i].rm_so] = tmp;
 	pmatch[i].rm_so = new_o; 
 
@@ -1589,7 +1615,7 @@
 	    continue;
 	tmp = string[pmatch[i].rm_eo];
 	string[pmatch[i].rm_eo] = 0;
-	new_o = mbstrlen(string);
+	new_o = real_mbstrlen(string);
 	string[pmatch[i].rm_eo] = tmp;
 	pmatch[i].rm_eo = new_o; 
     }
Add REG_NEWLINE flag to regexp replace matching as it is unusual for '.' to
match newline, edit_find_string function already splits data on newlines before
passing it to string_regexp_search so multiline matching is already crippled.

--- mc-4.6.2~git20080311/edit/editcmd.c.orig	2008-06-23 02:22:30.000000000 +0200
+++ mc-4.6.2~git20080311/edit/editcmd.c	2008-06-23 02:23:34.000000000 +0200
@@ -1570,7 +1570,8 @@
 	    g_free (old_pattern);
 	    old_pattern = 0;
 	}
-	if (regcomp (&r, pattern, REG_EXTENDED | (icase ? REG_ICASE : 0))) {
+	if (regcomp (&r, pattern, REG_EXTENDED | (icase ? REG_ICASE : 0) |
+	    REG_NEWLINE)) {
 	    *found_len = 0;
 	    return -3;
 	}

--- End Message ---
--- Begin Message ---
Source: mc
Source-Version: 2:4.6.2~git20080311-3

We believe that the bug you reported is fixed in the latest version of
mc, which is due to be installed in the Debian FTP archive:

mc-dbg_4.6.2~git20080311-3_i386.deb
  to pool/main/m/mc/mc-dbg_4.6.2~git20080311-3_i386.deb
mc_4.6.2~git20080311-3.diff.gz
  to pool/main/m/mc/mc_4.6.2~git20080311-3.diff.gz
mc_4.6.2~git20080311-3.dsc
  to pool/main/m/mc/mc_4.6.2~git20080311-3.dsc
mc_4.6.2~git20080311-3_i386.deb
  to pool/main/m/mc/mc_4.6.2~git20080311-3_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Patrick Winnertz <[EMAIL PROTECTED]> (supplier of updated mc package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 21 Jul 2008 22:40:58 +0200
Source: mc
Binary: mc mc-dbg
Architecture: source i386
Version: 2:4.6.2~git20080311-3
Distribution: unstable
Urgency: medium
Maintainer: Debian MC Packaging Group <[EMAIL PROTECTED]>
Changed-By: Patrick Winnertz <[EMAIL PROTECTED]>
Description: 
 mc         - midnight commander - a powerful file manager
 mc-dbg     - midnight commander - a powerful file manager - debug package
Closes: 471543 487611 487863 487936 488465 489631 489751 492019
Changes: 
 mc (2:4.6.2~git20080311-3) unstable; urgency=medium
 .
   * Correct translation of Free space. Thanks to Sven Joachim.
     (Closes: #471543)
   * Build depends on libgpm-dev (Closes: #487863)
   * Bump standards version to 3.8.0, no further changes needed.
   * ReAdd regexp-replace-fixed.patch, dropped by a communication error,
     between me and the submitter. (Closes: 487611)
   * Highlight also .inc files as php if they are written in php.
     (Closes: 487936)
   * Enabled whitespace feature again. (Closes: #488465)
   * Use odt2txt to show openoffice documents. (Closes: #492019)
   * Fix typo in mc.ext (Closes: #489751)
   * Fix bashisms, in some extfs files. (Closes: #489631)
Checksums-Sha1: 
 e238bdd012e903cef253044ce7edf65e75d6fd0f 1220 mc_4.6.2~git20080311-3.dsc
 d6c816d42ce83c7f54d759022b2766b749472c3e 874579 mc_4.6.2~git20080311-3.diff.gz
 45a3e4b5425a50f288d7ef1f1557b776d7a7ed26 2132932 
mc_4.6.2~git20080311-3_i386.deb
 31f7800e40ddafd1d24515f73b93c40a3c204a92 596662 
mc-dbg_4.6.2~git20080311-3_i386.deb
Checksums-Sha256: 
 ee078145aa2de149e7cce7d7b59c55080e343bc46c52521e99a8b67a7b8d8bbd 1220 
mc_4.6.2~git20080311-3.dsc
 d2158dd657f1003e46287bfe0a0432d26e2b088895fc316e7dd57910d484bea7 874579 
mc_4.6.2~git20080311-3.diff.gz
 5192400fd4d6031a3e63853cf11cfd96b012436072aeeabb03b846be2a41c9e3 2132932 
mc_4.6.2~git20080311-3_i386.deb
 163a2ed13a34dd9c89153d856234fbd26a1d40011e78e31f959630b561d6ff32 596662 
mc-dbg_4.6.2~git20080311-3_i386.deb
Files: 
 38d49b0805e625ecffecf1a914f1e08a 1220 utils optional mc_4.6.2~git20080311-3.dsc
 f894147de66e741b2d513a739543d4fd 874579 utils optional 
mc_4.6.2~git20080311-3.diff.gz
 2a72af210c4c84834c3cec50775286e9 2132932 utils optional 
mc_4.6.2~git20080311-3_i386.deb
 434ccab9c22c1abe9346c3a833dfa455 596662 utils extra 
mc-dbg_4.6.2~git20080311-3_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkiK9I8ACgkQzgm26bkTFDpyCQCgqDED7QUjELjJG6j0eZqoVCNl
1LIAn1NZkAhu0qwl/1WOMEC7/TIkgX3A
=jk9o
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to