Fix regression in 0.8.41 that broke calibre if the TMP or TEMP environment variable is set to the root of a drive.

This commit is contained in:
Kovid Goyal 2012-02-25 10:22:54 +05:30
parent 99892dc98f
commit 9df6413df5

View File

@ -199,7 +199,5 @@ def get_windows_temp_path():
buf = ctypes.create_unicode_buffer(u'\0'*n) buf = ctypes.create_unicode_buffer(u'\0'*n)
ctypes.windll.kernel32.GetTempPathW(n, buf) ctypes.windll.kernel32.GetTempPathW(n, buf)
ans = buf.value ans = buf.value
if ans[-1] == u'\\':
ans = ans[:-1]
return ans if ans else None return ans if ans else None