]> git.lyx.org Git - lyx.git/blobdiff - lib/configure.py
Update all templates to current version. (This probably should have
[lyx.git] / lib / configure.py
index 7b76d69d670f5f1d2a08400fbf19fcb292aa42b9..c14bf0b04a1ef15f9375c6a1da6635378ed4942a 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('\\', '/')
@@ -117,6 +118,8 @@ def checkTeXPaths():
         os.write(fd, r'\relax')
         os.close(fd)
         latex_out = cmdOutput(r'latex "\nonstopmode\input{%s}"' % inpname)
+        if 'Error' in latex_out:
+            latex_out = cmdOutput(r'latex "\nonstopmode\input{\"%s\"}"' % inpname)
         if 'Error' in latex_out:
             logger.warning("configure: TeX engine needs posix-style paths in latex files")
             windows_style_tex_paths = 'false'
@@ -1300,7 +1303,7 @@ def checkTeXAllowSpaces():
         msg = "Checking whether TeX allows spaces in file names... "
         writeToFile('a b.tex', r'\message{working^^J}' )
         if LATEX != '':
-            if os.name == 'nt':
+            if os.name == 'nt' or sys.platform == 'cygwin':
                 latex_out = cmdOutput(LATEX + r""" "\nonstopmode\input{\"a b\"}" """)
             else:
                 latex_out = cmdOutput(LATEX + r""" '\nonstopmode\input{"a b"}' """)