]> git.lyx.org Git - lyx.git/commitdiff
Initialize correctly SystemcallPrivate in constructor
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 9 Jun 2016 15:34:14 +0000 (17:34 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 9 Jun 2016 15:34:14 +0000 (17:34 +0200)
It seems that Error is the best possibility when nothing has been done yet.

Found by Coverity

src/support/Systemcall.cpp

index a2f6a6f868631967b03390d04dbb4b7b3b4213ff..5dd4a94e1681e206b4ca4a5f7cdcf0c81a5769c8 100644 (file)
@@ -295,16 +295,10 @@ int Systemcall::startscript(Starttype how, string const & what,
 }
 
 
-SystemcallPrivate::SystemcallPrivate(std::string const & sf,
-                                    std::string const & of,
-                                    std::string const & ef) :
-                               process_(new QProcess), 
-                               out_index_(0),
-                               err_index_(0),
-                               in_file_(sf),
-                               out_file_(of), 
-                               err_file_(ef), 
-                               process_events_(false)
+SystemcallPrivate::SystemcallPrivate(std::string const & sf, std::string const & of,
+                                     std::string const & ef)
+       : state(Error), process_(new QProcess), out_index_(0), err_index_(0),
+         in_file_(sf), out_file_(of), err_file_(ef), process_events_(false)
 {
        if (!in_file_.empty())
                process_->setStandardInputFile(QString::fromLocal8Bit(in_file_.c_str()));