Check-in [320bbe752c]
Not logged in
Overview
SHA1:320bbe752cb7e89e8cff286c3d7e2b54401d16ae
Date: 2014-03-17 21:17:49
User: quentin@minster.io
Comment:Enhance a bit of logic (expr should be cheaper than regexp)
Timelines: family | ancestors | descendants | both | trunk | origin/devel
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2014-03-17
21:47
[9607f1bb70] Remove seemingly useless file (user: quentin@minster.io, tags: trunk, origin/devel)
21:17
[320bbe752c] Enhance a bit of logic (expr should be cheaper than regexp) (user: quentin@minster.io, tags: trunk, origin/devel)
21:17
[dc9268f6ad] Harmonize style in all Tcl files Brace arguments of if/expr constructs (user: quentin@minster.io, tags: trunk, origin/devel)
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified tclreadlineSetup.tcl.in from [3c98c4bea3] to [c9b75e0523].

     6      6   # Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
     7      7   # This software is copyright under the BSD license.
     8      8   # ---
     9      9   
    10     10   
    11     11   package provide tclreadline @VERSION@
    12     12   
           13  +rename unknown _unknown
    13     14   proc unknown args {
    14     15   
    15     16       global auto_noexec auto_noload env unknown_pending tcl_interactive
    16     17       global errorCode errorInfo
    17     18   
    18     19       # Save the values of errorCode and errorInfo variables, since they
    19     20       # may get modified if caught errors occur below.  The variables will
................................................................................
   306    307       }
   307    308   
   308    309       proc Print {args} {
   309    310           variable PRINT
   310    311           if {![info exists PRINT]} {
   311    312               set PRINT yes
   312    313           }
   313         -        if [regexp -nocase \(true\|yes\|1\) $args] {
   314         -            set PRINT yes
   315         -        } elseif [regexp -nocase \(false\|no\|0\) $args] {
   316         -            set PRINT no
   317         -        }
          314  +        catch {set PRINT [expr {$args ? "yes" : "no"}]}
   318    315           return $PRINT
   319    316       }
   320    317   
   321    318   
   322    319   #    proc InitCmds {} {
   323    320   #        # XXX
   324    321   #        return