Review Request 129599: segfault when ruby was not installed

Sven Brauch mail at svenbrauch.de
Mon Dec 5 08:05:27 UTC 2016



> On Dec. 5, 2016, 8:04 a.m., Sven Brauch wrote:
> > languagesupport.cpp, line 74
> > <https://git.reviewboard.kde.org/r/129599/diff/3/?file=487041#file487041line74>
> >
> >     no, sorry, like this:
> >      auto path = QStandardPaths::findExecutable("ruby")
> >      if ( !path.isEmpty() ) {
> >        QProcess p;
> >        p.start(path, {"--version"});
> >        ...
> >      }

The idea is that QStandardPaths figueres out the path for you, so you don't have to give an explicit path. The advantage is that it works on other operating systems as well, and also if ruby is not in /usr/bin/ruby but, say, /home/user/install/bin/ruby.


- Sven


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129599/#review101292
-----------------------------------------------------------


On Dec. 5, 2016, 2:32 a.m., Leslie Zhai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/129599/
> -----------------------------------------------------------
> 
> (Updated Dec. 5, 2016, 2:32 a.m.)
> 
> 
> Review request for KDevelop and Kevin Funk.
> 
> 
> Repository: kdev-ruby
> 
> 
> Description
> -------
> 
> if ruby was not installed, ruby.readAllStandardOutput().split(' ')'s size is ZERO, so I simply added the check:
> 
> ```
> QByteArray allOutput = ruby.readAllStandardOutput();
> if (allOutput.split(' ').size() > 1)
> ```
> 
> 
> Diffs
> -----
> 
>   languagesupport.cpp d618d7d 
> 
> Diff: https://git.reviewboard.kde.org/r/129599/diff/
> 
> 
> Testing
> -------
> 
> 1. Not intalled ruby, kdevelop import redmin (a bug tracker written in ruby) will NOT segfault
> 2. Installed ruby, the same story
> 
> 
> Thanks,
> 
> Leslie Zhai
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20161205/bc6a3fc0/attachment.html>


More information about the KDevelop-devel mailing list