浏览代码

Update tree.tcl

Capitan Cloud 9 月之前
父节点
当前提交
1765beeb57
共有 1 个文件被更改,包括 13 次插入12 次删除
  1. 13 12
      tree.tcl

+ 13 - 12
tree.tcl

@@ -464,6 +464,10 @@ namespace eval tree {
 		# 2. put the directories to the beginning of the file list
 		set i 0
 		foreach fname $dcont {
+                    set start [expr [string length $fname]-2]
+                    set last [expr [string length $fname]-1]
+                    set d [string range $fname $start $last]
+		    if {$d ne " y"} {
  			if {[file isdirectory $fname]} {
 	 			set dcont [lreplace $dcont $i $i [list $fname "y"]]
 				set nroot [addToDirContent $lev 0 $fname $iroot]
@@ -476,6 +480,7 @@ namespace eval tree {
 				set dcont [lreplace $dcont $i $i [list $fname]]
 			}
 			incr i
+                    }
 		}		
 
 		
@@ -493,14 +498,12 @@ namespace eval tree {
 		}
 		if {[llength $_dirtree] < $dan(MAXFILES)} {
 		  foreach fname $dcont {
-                    lassign $fname fnamenan d
-                    if {$d ne "y"} {
-                      set d " "
-                    }
-                    #set d " " 
                     set fname [string map {"\"" "\'"} $fname] 
+                    set start [expr [string length $fname]-2]
+                    set last [expr [string length $fname]-1]
+                    set d [string range $fname $start $last]
 		    #lassign $fname fname d
-		    if {$d ne "y"} {
+		    if {$d ne " y"} {
 		      #tk_messageBox -title $dan(TITLE) -icon error -message $fname
 		      foreach gl [split $globs ","] {
 		        if {[string match $gl $fname]} {
@@ -523,14 +526,12 @@ namespace eval tree {
 		}
 		if {[llength $_dirtree] < $dan(MAXFILES)} {
 		  foreach fname $dcont {
-		    lassign $fname fnamenan d
-                    if {$d ne "y"} {
-                      set d " "
-                    }
-                    #set d " "
                     set fname [string map {"\"" "\'"} $fname] 
+                    set start [expr [string length $fname]-2]
+                    set last [expr [string length $fname]-1]
+                    set d [string range $fname $start $last]
                     #lassign $fname fname d
-		    if {$d ne "y"} {
+		    if {$d ne " y"} {
 		      #tk_messageBox -title $dan(TITLE) -icon error -message $fname
 		      foreach gl [split $globs ","] {
 		        if {[string match $gl $fname]} {