Browse Source

ob-sql.el: Fix filename conversion in minGW environment.

(org-babel-sql-convert-standard-filename): If it is not in Cygwin
environment, and `system-nt' is "windows-nt", Emacs must be in minGW
or MSYS environment, and can handle Windows filename correctly.

TINYCHANGE
Xi Shen 8 years ago
parent
commit
93972c9845
1 changed files with 7 additions and 7 deletions
  1. 7 7
      lisp/ob-sql.el

+ 7 - 7
lisp/ob-sql.el

@@ -117,14 +117,14 @@ SQL Server on Windows and Linux platform."
 	     " "))
 
 (defun org-babel-sql-convert-standard-filename (file)
-  "Convert the file name to OS standard.
+  "Convert FILE to OS standard file name.
 If in Cygwin environment, uses Cygwin specific function to
-convert the file name. Otherwise, uses Emacs' standard conversion
-function."
-  (format "\"%s\""
-	  (if (fboundp 'cygwin-convert-file-name-to-windows)
-	      (cygwin-convert-file-name-to-windows file)
-	    (convert-standard-filename file))))
+convert the file name.  In a Windows-NT environment, do nothing.
+Otherwise, use Emacs' standard conversion function."
+  (cond ((fboundp 'cygwin-convert-file-name-to-windows)
+	 (format "%S" (cygwin-convert-file-name-to-windows file)))
+	((string= "windows-nt" system-type) file)
+	(t (format "%S" (convert-standard-filename file)))))
 
 (defun org-babel-execute:sql (body params)
   "Execute a block of Sql code with Babel.