From bd9d3cb0ebd9182d652e275a8f82337e02d0ca04 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 1 Jun 2011 01:51:17 +0000 Subject: [PATCH] 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 --- lib/configure.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/configure.py b/lib/configure.py index ba87cd7104..6b59150950 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -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('\\', '/') -- 2.39.2