Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b443a31d0f4fac177a283cfc3ed2a4dd15c17c96
Ticket: 1505383fffffffffffffffffffffffffffffffff
clock format %W broken
User & Date: tallniel on 2006-06-13 12:55:14
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    clock format %W option is broken in current CVS:
    
    % info pa
    8.5a5
    % clock format [clock seconds] -format %W
    can't read "Wweeknumber": no such variable
    % set errorInfo
    can't read "Wweeknumber": no such variable
        while executing
    "::format %02d  $Wweeknumber"
        (procedure "::tcl::clock::formatproc'%W'C" line 11)
        invoked from within
    "$formatter $clockval $timezone"
        (procedure "::tcl::clock::format" line 74)
        invoked from within
    "::tcl::clock::format 1150202323 -format %W"
        ("uplevel" body line 1)
        invoked from within
    "uplevel 1 [info level 0]"
        (procedure "::tcl::clock::format" line 4)
        invoked from within
    "clock format [clock seconds] -format %W"
    % info body tcl::clock::formatproc'%W'C
    
            
                     variable TZData
                     set date [GetDateFields $clockval 
    $TZData($timezone)  2299161]
                 
                                set WweekNumber  [expr { (
    [dict get $date dayOfYear]
                                              - [dict get
    $date dayOfWeek]
                                              + 7 ) 
                                            / 7 }]
    
            return [::format %02d  $Wweeknumber]
    
    The problem is this last reference to $Wweeknumber in
    the format: the 'n' should be capitalised. As this is
    generated code, the actual bug is in library/clock.tcl
    line 4625, proc tcl::clock::ParseClockFormatFormat2. I
    attach a patch that fixes this.
    
  4. foundin changed to: "obsolete: 8.5a5"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "tallniel"
  9. subsystem changed to: "16. Commands A-H"
  10. title changed to: "clock format %W broken"
  11. type changed to: "Bug"