From 9c4e6ae34ea06c776ebbf5410f7bc1ce78edad2f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 4 Jul 2009 20:29:15 +0100 Subject: [PATCH] actually do version protocol; use tempfile to stop exec truncating our binary ppm --- pctb/README.files | 3 ++- pctb/dictionary-manager | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pctb/README.files b/pctb/README.files index 7622913..254217a 100644 --- a/pctb/README.files +++ b/pctb/README.files @@ -77,6 +77,7 @@ The program reads and writes the following files: * .tmp When any of these tools overwrite one of the persistent dictionary - files, they temporarily write to .tmp. + files, they temporarily write to .tmp. We also use a couple + of other temporary files. Future versions may have more helpers and more data files. diff --git a/pctb/dictionary-manager b/pctb/dictionary-manager index 0ecad0d..d9de00c 100755 --- a/pctb/dictionary-manager +++ b/pctb/dictionary-manager @@ -517,7 +517,7 @@ proc upload_status {} { } proc maybe_upload_entry {im def} { - global reqkind privacy_setting env dbname quiet + global reqkind privacy_setting env dbname quiet aadepth debug "DB-UPDATE PRIVACY $privacy_setting" if {!$privacy_setting} return @@ -526,6 +526,8 @@ proc maybe_upload_entry {im def} { set pl {} lappend pl dict $dbname + lappend pl version 3 + lappend pl depth $aadepth if {$privacy_setting>=2} { set pirate [string totitle $env(YPPSC_PIRATE)] @@ -693,9 +695,11 @@ proc char_read_pgm {f} { append o $ointerl } -# debug "DATA $o" - set data [exec pnmscale 1 << $o] - image create photo image/main -data $data + debug "DATA1 $o" + set tmpfile ./#dictimage#.tmp + exec pnmscale 1 << $o >$tmpfile + image create photo image/main -file $tmpfile + file delete $tmpfile } #---------- character set editor display ---------- -- 2.30.2