Bug 209885

Summary: KDiff3 preprocessor command won't accept single quotes like the docs say
Product: [Applications] kdiff3 Reporter: Greg Rundlett <greg>
Component: applicationAssignee: michael <reeves.87>
Status: RESOLVED FIXED    
Severity: normal CC: reeves.87
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 1.7
Sentry Crash Report:

Description Greg Rundlett 2009-10-08 17:17:31 UTC
Version:           0.9.94 (using KDE 4.2.4)
OS:                Linux
Installed from:    Ubuntu Packages

On

http://kdiff3.sourceforge.net/doc/preprocessors.html

All the examples use single quote characters to show example preprocessor commands.  However, using KDiff3 0.9.94, the preprocessor does not accept single quotes (it Fails) while it does work using double quotes.

For example, this command
    /bin/sed "s/.*/ /"
will work

however
  /bin/sed 's/.*/ /'
will fail and preprocessing will subsequently get disabled

Initially I thought the problem was in the sed command I was using.  But, when I could prove the command worked in the console, I then checked the usage of the quote characters and found that is what was causing problems for me in kdiff3.

This must be a regression, because I'm positive that the documentation examples worked in the past, and believe that there are pre-loaded "suggestions" which use the single quote character -- but don't work.


-- 
Greg Rundlett | Director | Technology

Bean Group | Portsmouth
72 Mirona Road,
Portsmouth, NH 03801
Office: (603) 766-1980 x7007
Email: greg@beangroup.com
Web: beangroup.com
Facebook: beangroup.com/facebook
Twitter: twitter.com/beangroup
Comment 1 Joachim Eibl 2009-10-12 11:37:51 UTC
Hi Greg,
Thank you for telling me. I already noticed a problem, but your observation is more precise. Previously KDiff3 used the system()-command to run the preprocessors. Now KDiff3 uses QProcess which seems to behave differently in this respect. I probably can't change the behaviour but I will have to update the docs and perhaps try to detect such commands and warn the user.
Cheers,
Joachim
Comment 2 michael 2018-07-09 05:17:37 UTC
Git commit 311bf4ea4b5b4ee4b3c3b7fd46553cf60b3a45aa by Michael Reeves.
Committed on 09/07/2018 at 03:13.
Pushed by mreeves into branch 'master'.

Fix behavior of preprocessor for sigle quotes

The distinction between single and double quotes is purly a command
shell issue. So silently convert to double quotes.
Also change escaping to QTs non-standard form for double quotes if
contained in single quotes.
FIXED-IN: 1.7

M  +0    -2    doc/en/index.docbook
M  +23   -2    src/pdiff.cpp

https://commits.kde.org/kdiff3/311bf4ea4b5b4ee4b3c3b7fd46553cf60b3a45aa