Browse Source

trim filepath quotes

fixes windows filepathes
Julien Schmidt 12 years ago
parent
commit
0e8690a9f2
1 changed files with 2 additions and 1 deletions
  1. 2 1
      infile.go

+ 2 - 1
infile.go

@@ -32,7 +32,7 @@ func init() {
 // Alternatively you can allow the use of all local files with
 // the DSN parameter 'allowAllFiles=true'
 func RegisterLocalFile(filepath string) {
-	fileRegister[filepath] = true
+	fileRegister[strings.Trim(filepath, `"`)] = true
 }
 
 // RegisterReaderHandler registers a handler function which is used
@@ -62,6 +62,7 @@ func (mc *mysqlConn) handleInFileRequest(name string) (err error) {
 			}
 		}
 	} else { // File
+		name = strings.Trim(name, `"`)
 		if fileRegister[name] || mc.cfg.params[`allowAllFiles`] == `true` {
 			rdr, err = os.Open(name)
 		} else {