[Dctrl-tools-devel] [SCM] Debian control file query tools branch, master, updated. 2.18-14-gb999fc2

Antti-Juhani Kaijanaho ajk at debian.org
Thu Jul 28 10:25:56 UTC 2011


The following commit has been merged in the master branch:
commit b999fc22729ec0644bb63be4c3279b0645fca700
Author: Antti-Juhani Kaijanaho <ajk at debian.org>
Date:   Thu Jul 28 13:25:33 2011 +0300

    #209134: Print the field name as in the paragraph, not as on command line
    
    Signed-off-by: Antti-Juhani Kaijanaho <ajk at debian.org>

diff --git a/debian/changelog b/debian/changelog
index 0a43471..09a3e95 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,8 +12,12 @@ dctrl-tools (2.19) UNRELEASED; urgency=low
     Closes: #525525 (do not separate stanzas with empty lines when showing
                      Description field only)
     [Reported by Stefano Zacchiroli <zack at debian.org>]
+  * lib/paragraph.[ch], grep-dctrl/grep-dctrl.c: Use the actual spelling of
+    field names in output, instead of the command line spelling.
+    Closes: #209134 (keyword case shouldn't be influenced by -s)
+    Reported by Dan Jacobson <jidanni at jidanni.org>.
 
- -- Antti-Juhani Kaijanaho <ajk at debian.org>  Thu, 28 Jul 2011 12:45:01 +0300
+ -- Antti-Juhani Kaijanaho <ajk at debian.org>  Thu, 28 Jul 2011 13:24:12 +0300
 
 dctrl-tools (2.18ubuntu1) oneiric; urgency=low
 
diff --git a/grep-dctrl/grep-dctrl.c b/grep-dctrl/grep-dctrl.c
index 115b278..a80ca30 100644
--- a/grep-dctrl/grep-dctrl.c
+++ b/grep-dctrl/grep-dctrl.c
@@ -787,7 +787,12 @@ static void show_field(struct arguments *args,
         }
 
         if (args->show_field_name) {
-                printf("%s: ", fa->name);
+                struct fsaf_read_rv rn =
+                        fsaf_read(para->common->fp,
+                                  fd->name_start,
+                                  fd->name_end - fd->name_start);
+                fwrite(rn.b, 1, rn.len, stdout);
+                fputs(": ", stdout);
         }
 
         fwrite(r.b, 1, r.len, stdout);
diff --git a/lib/paragraph.c b/lib/paragraph.c
index 8efbd6e..4f91a2e 100644
--- a/lib/paragraph.c
+++ b/lib/paragraph.c
@@ -1,5 +1,5 @@
 /*  dctrl-tools - Debian control file inspection tools
-    Copyright © 2003, 2004, 2008, 2010 Antti-Juhani Kaijanaho
+    Copyright © 2003, 2004, 2008, 2010, 2011 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
@@ -185,6 +185,8 @@ FIELD_NAME:
                         field_data->present = 1;
                         field_data->start = pos;
                         field_data->line = line;
+                        field_data->name_start = field_start;
+                        field_data->name_end = pos-1;
                 }
                 goto BODY;
         }
diff --git a/lib/paragraph.h b/lib/paragraph.h
index c785b8f..a8be095 100644
--- a/lib/paragraph.h
+++ b/lib/paragraph.h
@@ -1,5 +1,5 @@
 /*  dctrl-tools - Debian control file inspection tools
-    Copyright © 2003, 2004, 2005, 2010 Antti-Juhani Kaijanaho
+    Copyright © 2003, 2004, 2005, 2010, 2011 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
@@ -29,6 +29,7 @@ struct field_data {
         _Bool present;
 	size_t line;
 	size_t start, end; /* offsets to the file; [start,end) is the body */
+        size_t name_start, name_end; /* as start and end, but for the name */
 };
 
 struct paragraph_parser {

-- 
Debian control file query tools



More information about the Dctrl-tools-devel mailing list