]> git.lyx.org Git - features.git/commitdiff
Query about the exact length of a short name, as it may happen that
authorEnrico Forestieri <forenr@lyx.org>
Wed, 1 Jun 2011 01:51:17 +0000 (01:51 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Wed, 1 Jun 2011 01:51:17 +0000 (01:51 +0000)
a short name length is actually greater than the long name length.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38908 a592a061-630c-0410-9148-cb99ea01b6c8

lib/configure.py

index ba87cd71046a19ebd725ebc371a06055cc35302f..6b591509501bb1c7a7436cd21eeff413030de608 100644 (file)
@@ -105,8 +105,9 @@ def checkTeXPaths():
             from ctypes import windll, create_unicode_buffer
             GetShortPathName = windll.kernel32.GetShortPathNameW
             longname = unicode(tmpfname)
-            shortname = create_unicode_buffer(len(longname)+1)
-            if GetShortPathName(longname, shortname, len(longname)+1):
+            shortlen = GetShortPathName(longname, 0, 0)
+            shortname = create_unicode_buffer(shortlen)
+            if GetShortPathName(longname, shortname, shortlen):
                 inpname = shortname.value.replace('\\', '/')
             else:
                 inpname = tmpfname.replace('\\', '/')