Hello,

The comment in function vim_tempname says: "GetTempPath() failed, use current dir". It use "szTempFile[0] = NUL" to do this, which makes szTempFile an empty
string. szTempFile is going to be passed as a parameter to the function
GetTempFileName. However, if we want to use current directory, we should
szTempFile to ".", but not NULL.

See the Parameters->lpPathName part on the following link:
http://msdn.microsoft.com/en-us/library/aa364991%28v=VS.85%29.aspx

Regards,
Hong Xu
2011/2/5

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff -r fcea35e2a41f src/fileio.c
--- a/src/fileio.c      Tue Feb 01 21:55:01 2011 +0100
+++ b/src/fileio.c      Sat Feb 05 20:29:44 2011 +0800
@@ -7459,7 +7459,7 @@
 
     STRCPY(itmp, "");
     if (GetTempPath(_MAX_PATH, szTempFile) == 0)
-       szTempFile[0] = NUL;    /* GetTempPath() failed, use current dir */
+       strcpy(szTempFile, "."); /* GetTempPath() failed, use current dir */
     strcpy(buf4, "VIM");
     buf4[2] = extra_char;   /* make it "VIa", "VIb", etc. */
     if (GetTempFileName(szTempFile, buf4, 0, itmp) == 0)

Raspunde prin e-mail lui