@@ -40,7 +40,10 @@ func files(pattern string, allowFiles bool) PredictFunc {
4040
4141 path := prediction [0 ]
4242 if strings .HasPrefix (a .Last , "~" ) {
43- path = resolveHomeSymbol (path )
43+ path = getAbs (path )
44+ }
45+ if strings .Contains (a .Last , ".." ) {
46+ path = getAbs (path )
4447 }
4548 // only try deeper, if the one item is a directory
4649 stat , err := os .Stat (path )
@@ -75,7 +78,7 @@ func PredictFilesSet(files []string) PredictFunc {
7578 f = fixPathForm (a .Last , f )
7679
7780 // test matching of file to the argument
78- if match .File (resolveHomeSymbol (f ), resolveHomeSymbol (a .Last )) {
81+ if match .File (getAbs (f ), getAbs (a .Last )) {
7982 prediction = append (prediction , f )
8083 }
8184 }
@@ -87,12 +90,8 @@ func listFiles(dir, pattern string, allowFiles bool) []string {
8790 // set of all file names
8891 m := map [string ]bool {}
8992
90- if strings .HasPrefix (pattern , "~" ) {
91- pattern = resolveHomeSymbol (pattern )
92- }
93-
9493 // list files
95- if files , err := filepath .Glob (filepath .Join (dir , pattern )); err == nil {
94+ if files , err := filepath .Glob (filepath .Join (dir , getAbs ( pattern ) )); err == nil {
9695 for _ , f := range files {
9796 if stat , err := os .Stat (f ); err != nil || stat .IsDir () || allowFiles {
9897 m [f ] = true
0 commit comments