Changeset 500 for trunk


Ignore:
Timestamp:
Aug 7, 2006, 8:46:23 AM (18 years ago)
Author:
nkissebe
Message:

Escape any backslashes found in tool string (primarily for the sake of Windows paths) before passing to bgexec eval.

Internally process "echo" commands found in tool string (primarily for Windows which does not have a usable external echo command to exec).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/tool.tcl

    r413 r500  
    135135        regsub -all @tool $cmd $_installdir cmd
    136136        regsub -all @driver $cmd $file cmd
     137        regsub -all {\\} $cmd {\\\\} cmd
     138        set cmd [string trimleft $cmd " "]
    137139
    138140        # starting job...
    139141        Rappture::rusage mark
    140142
     143        if {0 == [string compare -nocase -length 5 $cmd "ECHO "] } {
     144            set status 0;
     145            set job(output) [string range $cmd 5 end]
     146        } else {
    141147        set status [catch {eval blt::bgexec \
    142148            ::Rappture::Tool::job(control) \
     
    146152            -output ::Rappture::Tool::job(output) \
    147153            -error ::Rappture::Tool::job(error) $cmd} result]
    148 
     154        }
    149155        # ...job is finished
    150156        array set times [Rappture::rusage measure]
Note: See TracChangeset for help on using the changeset viewer.