From: Enrico Forestieri Date: Wed, 1 Jun 2011 01:51:17 +0000 (+0000) Subject: Query about the exact length of a short name, as it may happen that X-Git-Tag: 2.1.0beta1~3138 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=bd9d3cb0ebd9182d652e275a8f82337e02d0ca04;p=features.git 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 --- 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('\\', '/')