Changeset 140676 for trunk/base


Ignore:
Timestamp:
Sep 30, 2015, 3:38:56 AM (5 years ago)
Author:
jmr@…
Message:

follow-up to r129924: use realpath in porttrace::appendEntry instead of reimplementing it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/porttrace.tcl

    r140641 r140676  
    6868        lappend mapping "=" "\\="
    6969
    70         set normalizedPath [file normalize $path]
    7170        # file normalize will leave symlinks as the very last
    7271        # path component intact. This will, for instance, prevent /tmp from
    7372        # being resolved to /private/tmp.
    74         # Also use file readlink to counter this behavior.
    75         # file readlink returns an error, if the last component is not
    76         # a symlink. Catch that.
    77         set resolvedPath {}
    78         if {![catch {file readlink $path}]} {
    79           set resolvedPath [file readlink $path]
    80 
    81           if {[string length $resolvedPath] > 0 && [string index $resolvedPath 0] ne "/"} {
    82               # Canonicalize.
    83               set resolvedPath [file normalize [file dirname $path]/$resolvedPath]
    84           }
    85         }
     73        # Use realpath to avoid this behavior.
     74        set normalizedPath [realpath $path]
    8675        lappend sndbxlst "[string map $mapping $path]=$action"
    8776        if {$normalizedPath ne $path} {
    8877            lappend sndbxlst "[string map $mapping $normalizedPath]=$action"
    89         }
    90         if {[string length $resolvedPath] > 0 && $resolvedPath ne $path} {
    91             lappend sndbxlst "[string map $mapping $resolvedPath]=$action"
    9278        }
    9379    }
Note: See TracChangeset for help on using the changeset viewer.