]> git.lyx.org Git - features.git/commitdiff
Ticket 6266 Quoting Problem with QProcess: don't think we need any quotes (at least...
authorPeter Kümmel <syntheticpp@gmx.net>
Fri, 18 Dec 2009 12:20:22 +0000 (12:20 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Fri, 18 Dec 2009 12:20:22 +0000 (12:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32579 a592a061-630c-0410-9148-cb99ea01b6c8

lib/configure.py
src/support/Systemcall.cpp

index 5342fbd861297aeec0d7c1950fc91c851b21a148..9ece0e754139189d34a7f049e2024282c65534e2 100644 (file)
@@ -647,9 +647,9 @@ def checkConverterEntries():
         addToRC(r'''\copier    html       "python -tt $$s/scripts/ext_copy.py $$i $$o"''')
 
     # On SuSE the scripts have a .sh suffix, and on debian they are in /usr/share/tex4ht/
-    path, htmlconv = checkProg('a LaTeX -> MS Word converter', ["htlatex $$i 'html,word' 'symbol/!' '-cvalidate'", \
-        "htlatex.sh $$i 'html,word' 'symbol/!' '-cvalidate'", \
-        "/usr/share/tex4ht/htlatex $$i 'html,word' 'symbol/!' '-cvalidate'"],
+    path, htmlconv = checkProg('a LaTeX -> MS Word converter', ["htlatex $$i html,word symbol/! -cvalidate", \
+        "htlatex.sh $$i html,word symbol/! -cvalidate", \
+        "/usr/share/tex4ht/htlatex $$i html,word symbol/! -cvalidate"],
         rc_entry = [ r'\converter latex      wordhtml   "%%"   "needaux"' ])
     if htmlconv.find('htlatex') >= 0:
       addToRC(r'''\copier    wordhtml       "python -tt $$s/scripts/ext_copy.py -e html,png,css $$i $$o"''')
@@ -667,7 +667,7 @@ def checkConverterEntries():
     # Both SuSE and debian have oolatex
     checkProg('a LaTeX -> Open Document converter', [
         'oolatex $$i', 'mk4ht oolatex $$i', 'oolatex.sh $$i', '/usr/share/tex4ht/oolatex $$i',
-        'htlatex $$i \'xhtml,ooffice\' \'ooffice/! -cmozhtf\' \'-coo\' \'-cvalidate\''],
+        'htlatex $$i xhtml,ooffice ooffice/! -cmozhtf -coo -cvalidate'],
         rc_entry = [ r'\converter latex      odt        "%%"   "needaux"' ])
     # On windows it is called latex2rt.exe
     checkProg('a LaTeX -> RTF converter', ['latex2rtf -p -S -o $$o $$i', 'latex2rt -p -S -o $$o $$i'],
index 04d7ab9f7245541eeac79433f3abcef5255e21ea..c5ac165bef9a9fad8b69e5ee968b647e6abcd138 100644 (file)
@@ -82,7 +82,7 @@ string const parsecmd(string const & cmd, string & outfile)
 
        for (size_t i = 0; i < cmd.length(); ++i) {
                char c = cmd[i];
-               if (c == '"' && !escaped)
+                if ((c == '"' || c == '\'') && !escaped)
                        inquote = !inquote;
                else if (c == '\\' && !escaped)
                        escaped = !escaped;
@@ -103,7 +103,12 @@ string const parsecmd(string const & cmd, string & outfile)
 int Systemcall::startscript(Starttype how, string const & what, bool process_events)
 {
        string outfile;
-       QString cmd = toqstr(parsecmd(what, outfile));
+        QString cmd = toqstr(parsecmd(what, outfile));
+        if (cmd.contains("'")) {
+            LYXERR0("Systemcall: '" << cmd << "' contains single quotes ', please check configuration, ' will be replaced by \"");
+            cmd = cmd.replace("'","\"");
+        }
+
        SystemcallPrivate d(outfile);