X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FChktex.C;h=ac08ba8879172a190d4f1fdf97bc7b5747f7e03d;hb=98c966c64594611e469313314abd1e59524adb4a;hp=87a8c18972b34c038a4f93d57dfbf646d6823da1;hpb=1fc767159174b183bc8356728b194f1f73e3b3e8;p=lyx.git diff --git a/src/Chktex.C b/src/Chktex.C index 87a8c18972..ac08ba8879 100644 --- a/src/Chktex.C +++ b/src/Chktex.C @@ -1,36 +1,36 @@ /* This file is part of - * ====================================================== - * - * LyX, The Document Processor + * ====================================================== + * + * LyX, The Document Processor * Copyright 1995 Matthias Ettrich - * Copyright 1995-2000 The LyX Team. + * Copyright 1995-2001 The LyX Team. * * This file is Copyright 1997-1998 * Asger Alstrup * - * ====================================================== + * ====================================================== */ #include -#include -#include // atoi - #ifdef __GNUG__ #pragma implementation #endif #include "Chktex.h" #include "LaTeX.h" // TeXErrors -#include "support/filetools.h" #include "lyxlex.h" -#include "support/FileInfo.h" #include "debug.h" -#include "support/syscall.h" -#include "support/syscontr.h" -#include "support/path.h" #include "gettext.h" +#include "support/FileInfo.h" +#include "support/filetools.h" +#include "support/systemcall.h" +#include "support/path.h" +#include "support/lstrings.h" + +#include + using std::ifstream; using std::getline; @@ -49,8 +49,8 @@ int Chktex::run(TeXErrors &terr) // run bibtex string log = OnlyFilename(ChangeExtension(file, ".log")); string tmp = cmd + " -q -v0 -b0 -x " + file + " -o " + log; - Systemcalls one; - int result= one.startscript(Systemcalls::System, tmp); + Systemcall one; + int result= one.startscript(Systemcall::Wait, tmp); if (result == 0) { result = scanLogFile(terr); } else { @@ -69,14 +69,18 @@ int Chktex::scanLogFile(TeXErrors & terr) ifstream ifs(tmp.c_str()); while (getline(ifs, token)) { - string srcfile, line, pos, warno, warning; + string srcfile; + string line; + string pos; + string warno; + string warning; token = split(token, srcfile, ':'); token = split(token, line, ':'); token = split(token, pos, ':'); token = split(token, warno, ':'); token = split(token, warning, ':'); - int lineno = atoi(line.c_str()); + int lineno = lyx::atoi(line); warno = _("ChkTeX warning id #") + warno; terr.insertError(lineno, warno, warning); ++retval;