Enrico Forestieri wrote:
> On Fri, Dec 18, 2009 at 01:20:23PM +0100, [email protected] wrote:
> 
>> Author: kuemmel
>> Date: Fri Dec 18 13:20:22 2009
>> New Revision: 32579
>> URL: http://www.lyx.org/trac/changeset/32579
>>
>> Log:
>> Ticket 6266 Quoting Problem with QProcess: don't think we need any quotes 
>> (at least on Linux)
> 
> This commit is totally wrong. First, you do not distinguish between single-
> and double-quotes quoting, such that "this is quoted and a ' is in here" is
> not correctly parsed. Second, you cannot arbitrarily change characters
> because, if you have a filename containing a single quote, the converter will
> fail. Try to insert an xfig file named foo'09.fig and see what happens when
> you try to view dvi, postscript, or pdf. This was working before this commit.
> Please revert.
> 

Thanks, I didn't thought someone likes single quotes
in his filenames. I've reverted the Systemcall.cpp patch.

configure.py should still be OK, because the quotes
the are du to spaces in filenames only, hope I'm not
totally wrong here, too.

Peter


> 
>> Modified:
>>    lyx-devel/trunk/lib/configure.py
>>    lyx-devel/trunk/src/support/Systemcall.cpp
>>
>> Modified: lyx-devel/trunk/lib/configure.py
>> ==============================================================================
>> --- lyx-devel/trunk/lib/configure.py Fri Dec 18 13:08:32 2009        (r32578)
>> +++ lyx-devel/trunk/lib/configure.py Fri Dec 18 13:20:22 2009        (r32579)
>> @@ -647,9 +647,9 @@
>>          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 @@
>>      # 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'],
>>
>> Modified: lyx-devel/trunk/src/support/Systemcall.cpp
>> ==============================================================================
>> --- lyx-devel/trunk/src/support/Systemcall.cpp       Fri Dec 18 13:08:32 
>> 2009        (r32578)
>> +++ lyx-devel/trunk/src/support/Systemcall.cpp       Fri Dec 18 13:20:22 
>> 2009        (r32579)
>> @@ -82,7 +82,7 @@
>>  
>>      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 @@
>>  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);
>>  
>>  
>>
> 

Reply via email to