Author: forenr
Date: Wed Jun  1 02:40:03 2011
New Revision: 38907
URL: http://www.lyx.org/trac/changeset/38907

Log:
On Windows, not all file systems provide for a short form of a filename,
so we have to account for this. Also, when checking whether TeX allows
spaces in file names, we try different quoting styles in order to account
for the kind of TeX engine used.

Modified:
   lyx-devel/trunk/lib/configure.py

Modified: lyx-devel/trunk/lib/configure.py
==============================================================================
--- lyx-devel/trunk/lib/configure.py    Tue May 31 22:23:06 2011        (r38906)
+++ lyx-devel/trunk/lib/configure.py    Wed Jun  1 02:40:03 2011        (r38907)
@@ -118,6 +118,8 @@
         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'
         else:
@@ -1300,8 +1302,10 @@
         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\"}" """)
+                if not 'working' in latex_out:
+                    latex_out = cmdOutput(LATEX + r' "\nonstopmode\input{a 
b}"')
             else:
                 latex_out = cmdOutput(LATEX + r""" '\nonstopmode\input{"a b"}' 
""")
         else:

Reply via email to