/ Check-in [50de9631]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:The 'replace.tcl' tool should use Unix line-endings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 50de96314f75494dc1f5b14d62c595a70c4e0638
User & Date: mistachkin 2016-08-02 19:29:56
Context
2016-08-02
20:42
Fix a unused variable that comes up with -DSQLITE_OMIT_DATETIME_FUNCS. check-in: e2f9919e user: drh tags: trunk
19:29
The 'replace.tcl' tool should use Unix line-endings. check-in: 50de9631 user: mistachkin tags: trunk
13:26
Updates to requirements marks. No changes to code. check-in: b23c10ac user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/replace.tcl.

     1      1   #!/usr/bin/tcl
     2      2   #
     3      3   # Replace string with another string -OR- include
     4      4   # only lines successfully modified with a regular
     5      5   # expression.
     6      6   #
            7  +fconfigure stdout -translation binary -encoding binary
            8  +fconfigure stderr -translation binary -encoding binary
     7      9   set mode [string tolower [lindex $argv 0]]
     8     10   set from [lindex $argv 1]
     9     11   set to [lindex $argv 2]
    10     12   if {$mode ni [list exact regsub include]} {exit 1}
    11     13   if {[string length $from]==0} {exit 2}
    12     14   while {![eof stdin]} {
    13     15     set line [gets stdin]