From: Adam Dickmeiss Date: Sat, 20 Mar 2004 07:16:25 +0000 (+0000) Subject: Use "" instead of 0 for last field 'from'. And test for end of list X-Git-Tag: YAZ.2.0.18 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=dd472005b2c12e54a0436d22e56970f48bc32704;p=yaz-moved-to-github.git Use "" instead of 0 for last field 'from'. And test for end of list by checking 'to' instead of 'from'. --- diff --git a/src/charconv.tcl b/src/charconv.tcl index 7d1fd07..fcc83fd 100755 --- a/src/charconv.tcl +++ b/src/charconv.tcl @@ -2,7 +2,7 @@ # the next line restats using tclsh \ exec tclsh "$0" "$@" # -# $Id: charconv.tcl,v 1.5 2004-03-17 11:00:04 adam Exp $ +# $Id: charconv.tcl,v 1.6 2004-03-20 07:16:25 adam Exp $ proc usage {} { puts {charconv.tcl: [-p prefix] [-s split] [-o ofile] file ... } @@ -57,7 +57,7 @@ proc preamble_trie {ofilehandle} { else { struct yaz_iconv_trie_flat *flat = t->flat; - while (flat->from) + while (flat->to) { size_t len = strlen(flat->from); if (len <= inbytesleft) @@ -177,7 +177,7 @@ proc dump_trie {ofilehandle} { puts -nonewline $f "\", 0x[lindex $m 1]" puts $f "\}," } - puts $f " \{0, 0\}" + puts $f " \{\"\", 0\}" puts $f "\};" puts $f "struct yaz_iconv_trie $trie(prefix)page${this} = \{" puts $f " $trie(prefix)page${this}_flat, 0"