[Tkabber-dev] r1830 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sat Aug 8 10:56:28 MSD 2009


Author: sergei
Date: 2009-08-08 10:56:27 +0400 (Sat, 08 Aug 2009)
New Revision: 1830

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/gpgme.tcl
Log:
	* gpgme.tcl: Don't switch GPG token property armor back and forth.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-08-07 17:23:11 UTC (rev 1829)
+++ trunk/tkabber/ChangeLog	2009-08-08 06:56:27 UTC (rev 1830)
@@ -1,3 +1,7 @@
+2009-08-08  Sergei Golovan  <sgolovan at nes.ru>
+
+	* gpgme.tcl: Don't switch GPG token property armor back and forth.
+
 2009-08-07  Sergei Golovan  <sgolovan at nes.ru>
 
 	* gpgme.tcl: Fixed typo.

Modified: trunk/tkabber/gpgme.tcl
===================================================================
--- trunk/tkabber/gpgme.tcl	2009-08-07 17:23:11 UTC (rev 1829)
+++ trunk/tkabber/gpgme.tcl	2009-08-08 06:56:27 UTC (rev 1830)
@@ -138,7 +138,7 @@
 }
 
 
-proc ::ssj::once_only {xlib {armorP 0}} {
+proc ::ssj::once_only {xlib} {
     global env
     variable options
     variable ctx
@@ -146,15 +146,12 @@
     debugmsg ssj "ONCE_ONLY $xlib"
 
     if {[info exists ctx($xlib)] && ![string equal $ctx($xlib) ""]} {
-        $ctx($xlib) set -property armor \
-			-value    $armorP
-
         return
     }
 
     set ctx($xlib) [gpg::new]
     $ctx($xlib) set -property armor \
-		    -value    $armorP
+		    -value    true
     $ctx($xlib) set -property encoding \
 		    -value    utf-8
 
@@ -368,10 +365,10 @@
 
 proc ::ssj::armor:encode {text} {
     if {[set x [string first "\n\n" $text]] >= 0} {
-        set text [string range $text [expr $x+2] end]
+        set text [string range $text [expr {$x + 2}] end]
     }
     if {[set x [string first "\n-----" $text]] > 0} {
-        set text [string range $text 0 [expr $x-1]]
+        set text [string range $text 0 [expr {$x - 1}]]
     }
 
     return $text
@@ -472,7 +469,7 @@
         return
     }
 
-    once_only $xlib 1
+    once_only $xlib
 
     if {[catch {$ctx($xlib) sign -input $data \
 				 -mode  detach} result]} {
@@ -816,7 +813,7 @@
 		       -validity full
     }
 
-    once_only $xlib 1
+    once_only $xlib
 
     set code \
 	[catch {
@@ -867,7 +864,7 @@
     while {([set x [string first <fpr> $s]] > 0) \
                 && ([set y [string first </fpr> $s]] > $x) \
                 && ($x+45 == $y)} {
-        lappend keys [string range $s [expr $x+20] [expr $y-1]]
+        lappend keys [string range $s [expr {$x + 20}] [expr {$y - 1}]]
         set s [string range $s $y end]
     }
 



More information about the Tkabber-dev mailing list