]> git.lyx.org Git - lyx.git/blob - src/support/systemcall.C
another safety belt
[lyx.git] / src / support / systemcall.C
1 /**
2  *  \file systemcall.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Asger Alstrup
7  *
8  * Interface cleaned up by
9  * \author Angus Leeming
10  *
11  * Full author contact details are available in file CREDITS
12  */
13
14 #include <config.h>
15
16 #ifdef __GNUG__
17 #pragma implementation
18 #endif
19
20 #include "systemcall.h"
21 #include "os.h"
22
23 #include <cstdlib>
24
25 #ifndef CXX_GLOBAL_CSTD
26 using std::system;
27 #endif
28
29 // Reuse of instance
30 int Systemcall::startscript(Starttype how, string const & what)
31 {
32         string command = what;
33
34         if (how == DontWait) {
35                 if (os::shell() == os::UNIX) {
36                         command += " &";
37                 } else {
38                         command = "start /min/n " + command;
39                 }
40         }
41
42         return ::system(command.c_str());
43 }