[Pkg-sks-commit] r135 - sks/trunk/sks/debian/patches

chrism at alioth.debian.org chrism at alioth.debian.org
Thu Jun 19 15:05:57 UTC 2008


Author: chrism
Date: 2008-06-19 15:05:56 +0000 (Thu, 19 Jun 2008)
New Revision: 135

Added:
   sks/trunk/sks/debian/patches/203_extra_space_in_fpr
Log:
[project @ 137]
Add a space in fingerprints, right in the middle

Original author: weasel
Date: 2004-03-24 08:25:34.123493+00:00

Added: sks/trunk/sks/debian/patches/203_extra_space_in_fpr
===================================================================
--- sks/trunk/sks/debian/patches/203_extra_space_in_fpr	                        (rev 0)
+++ sks/trunk/sks/debian/patches/203_extra_space_in_fpr	2008-06-19 15:05:56 UTC (rev 135)
@@ -0,0 +1,22 @@
+diff -ruN sks-1.0.7-old/fingerprint.ml sks-1.0.7/fingerprint.ml
+--- sks-1.0.7-old/fingerprint.ml	Sun Oct 12 22:20:18 2003
++++ sks-1.0.7/fingerprint.ml	Wed Mar 24 09:18:39 2004
+@@ -102,11 +102,17 @@
+ let fp_to_string fp = 
+   let bs = if (String.length fp) = 20 then 4 else 2 in
+   (* standard practice is to bunch long fingerprints by 4 and short ones by 2 *)
++  let extraspace = if (String.length fp) = 20 then ref 5 else ref 8 in
++  (* standard practice is to put an extra space just in the middle
++     That's after 8 blocks for short (MD5) and after 5 for long (SHA1) fingerprints *)
+   let hex = Utils.hexstring fp in
+   let buf = Buffer.create 0 in
+   for i = 0 to String.length hex / bs - 1 do
+     Buffer.add_substring buf hex (i * bs) bs;
+-    Buffer.add_string buf " "
++    Buffer.add_string buf " ";
++    decr extraspace;
++    if (!extraspace = 0) then
++      Buffer.add_string buf " "
+   done;
+   Buffer.contents buf
+ 




More information about the Pkg-sks-commit mailing list