[Dctrl-tools-devel] [SCM] Debian control file query tools branch, master, updated. 2.14-2-g0e53e16

Antti-Juhani Kaijanaho ajk at debian.org
Sat Dec 12 13:15:22 UTC 2009


The following commit has been merged in the master branch:
commit 0e53e16da117df9b76e979b6cf5c27f0ca64cb23
Author: Antti-Juhani Kaijanaho <ajk at debian.org>
Date:   Sat Dec 12 15:14:57 2009 +0200

    tbl-dctrl: Fix field line length detection for multi-line fields
    
    Signed-off-by: Antti-Juhani Kaijanaho <ajk at debian.org>

diff --git a/debian/changelog b/debian/changelog
index faaf223..9715860 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,9 @@
 dctrl-tools (2.15) UNRELEASED; urgency=low
 
-  * 
+  * tbl-dctrl: Fix field line length detection for multi-line fields
+    - Reported by Gerfried Fuchs <rhonda at debian.at> out of band.
 
- -- Antti-Juhani Kaijanaho <ajk at debian.org>  Sat, 05 Dec 2009 16:33:12 +0200
+ -- Antti-Juhani Kaijanaho <ajk at debian.org>  Sat, 12 Dec 2009 15:06:14 +0200
 
 dctrl-tools (2.14) unstable; urgency=low
 
diff --git a/tbl-dctrl/tbl-dctrl.c b/tbl-dctrl/tbl-dctrl.c
index 481082d..60026ae 100644
--- a/tbl-dctrl/tbl-dctrl.c
+++ b/tbl-dctrl/tbl-dctrl.c
@@ -1,5 +1,5 @@
 /*  dctrl-tools - Debian control file inspection tools
-    Copyright © 2005, 2006, 2007, 2008 Antti-Juhani Kaijanaho
+    Copyright © 2005, 2006, 2007, 2008, 2009 Antti-Juhani Kaijanaho
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -335,10 +335,16 @@ static struct argp argp = { options, parse_opt, 0, progdoc };
 static size_t mbs_len(char const *mbs, size_t n, char const *fname)
 {
 	if (n == (size_t)(-1)) n = strlen(mbs);
+        size_t mlen = 0;
 	size_t len = 0;
 	mblen(NULL, 0);
 	for (size_t k = 0; k < n;/**/) {
-		if (mbs[k] == '\n') break;
+		if (mbs[k] == '\n') {
+                        if (len > mlen) mlen = len;
+                        len = 0;
+                        k++;
+                        continue;
+                }
 		len++;
 		int delta = mblen(mbs + k, n - k);
 		if (delta <= 0) {
@@ -349,7 +355,7 @@ static size_t mbs_len(char const *mbs, size_t n, char const *fname)
 			k += delta;
 		}
 	}
-	return len;
+	return len > mlen ? len : mlen;
 }
 
 int main(int argc, char * argv[])

-- 
Debian control file query tools



More information about the Dctrl-tools-devel mailing list