mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
Query about the exact length of a short name, as it may happen that
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
This commit is contained in:
parent
ef51dbff8e
commit
bd9d3cb0eb
@ -105,8 +105,9 @@ def checkTeXPaths():
|
|||||||
from ctypes import windll, create_unicode_buffer
|
from ctypes import windll, create_unicode_buffer
|
||||||
GetShortPathName = windll.kernel32.GetShortPathNameW
|
GetShortPathName = windll.kernel32.GetShortPathNameW
|
||||||
longname = unicode(tmpfname)
|
longname = unicode(tmpfname)
|
||||||
shortname = create_unicode_buffer(len(longname)+1)
|
shortlen = GetShortPathName(longname, 0, 0)
|
||||||
if GetShortPathName(longname, shortname, len(longname)+1):
|
shortname = create_unicode_buffer(shortlen)
|
||||||
|
if GetShortPathName(longname, shortname, shortlen):
|
||||||
inpname = shortname.value.replace('\\', '/')
|
inpname = shortname.value.replace('\\', '/')
|
||||||
else:
|
else:
|
||||||
inpname = tmpfname.replace('\\', '/')
|
inpname = tmpfname.replace('\\', '/')
|
||||||
|
Loading…
Reference in New Issue
Block a user