Tcl Source Code

Check-in [66fe3ce72b]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:fix [glob] handling of leading //
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core_zip_vfs-aspect | core_zip_vfs-8-6
Files: files | file ages | folders
SHA3-256: 66fe3ce72b04dde03598cd7363a4b2fd55f93217c027b9cbafad8bd983b40100
User & Date: aspect 2017-11-17 11:53:19
Context
2017-11-17
12:39
Pulling changes from core-zip-vfs Closed-Leaf check-in: 79dde51515 user: hypnotoad tags: core_zip_vfs-aspect, core_zip_vfs-8-6
11:53
fix [glob] handling of leading // check-in: 66fe3ce72b user: aspect tags: core_zip_vfs-aspect, core_zip_vfs-8-6
10:24
clean up stray unused dstrings check-in: c30d1e6bb0 user: aspect tags: core_zip_vfs-aspect, core_zip_vfs-8-6
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to generic/tclFileName.c.

  1877   1877   	 * ':' no longer needed as a separator. It is only relevant to the
  1878   1878   	 * beginning of the path.
  1879   1879   	 */
  1880   1880   
  1881   1881   	separators = "/\\";
  1882   1882   
  1883   1883       } else if (tclPlatform == TCL_PLATFORM_UNIX) {
  1884         -	if (pathPrefix == NULL && tail[0] == '/') {
         1884  +	if (pathPrefix == NULL && tail[0] == '/' && tail[1] != '/') {
  1885   1885   	    pathPrefix = Tcl_NewStringObj(tail, 1);
  1886   1886   	    tail++;
  1887   1887   	    Tcl_IncrRefCount(pathPrefix);
  1888   1888   	}
  1889   1889       }
  1890   1890   
  1891   1891       /*

Changes to tests/zipfs.test.

    51     51   } -result [list $tcl_library/http $tcl_library/http1.0]
    52     52   
    53     53   test zipfs-0.5 {zipfs basics: glob} -constraints zipfs -body {
    54     54       lsort [glob -dir $tcl_library http*]
    55     55   } -result [list $tcl_library/http $tcl_library/http1.0]
    56     56   
    57     57   test zipfs-0.6 {zipfs basics: glob} -constraints zipfs -body {
    58         -    lsort [glob -tails -dir $tcl_library http*]
    59         -} -result {http http1.0}
           58  +    lsort [glob $tcl_library/http*]
           59  +} -result [list $tcl_library/http $tcl_library/http1.0]
    60     60   
    61     61   test zipfs-0.7 {zipfs basics: glob} -constraints zipfs -body {
    62         -    lsort [glob -nocomplain -tails -types d -dir $tcl_library http*]
           62  +    lsort [glob -tails -dir $tcl_library http*]
    63     63   } -result {http http1.0}
    64     64   
    65     65   test zipfs-0.8 {zipfs basics: glob} -constraints zipfs -body {
           66  +    lsort [glob -nocomplain -tails -types d -dir $tcl_library http*]
           67  +} -result {http http1.0}
           68  +
           69  +test zipfs-0.9 {zipfs basics: glob} -constraints zipfs -body {
    66     70       lsort [glob -nocomplain -tails -types f -dir $tcl_library http*]
    67     71   } -result {}
    68     72   
    69     73   
    70     74   test zipfs-1.3 {zipfs errors} -constraints zipfs -returnCodes error -body {
    71     75       zipfs mount a b c d e f
    72     76   } -result {wrong # args: should be "zipfs mount ?zipfile? ?mountpoint? ?password?"}