From 3379d2caf9ee3a5b495144b395ccfa053fe699f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20D=C5=82ugo=C5=82=C4=99cki?= Date: Tue, 2 Feb 2016 22:42:45 +0100 Subject: [PATCH] More detailed error messages in preprocessor --- src/preproc/prep.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/preproc/prep.cpp b/src/preproc/prep.cpp index 142a1ca..020b332 100644 --- a/src/preproc/prep.cpp +++ b/src/preproc/prep.cpp @@ -6,7 +6,6 @@ #include #include #include -#include class IncFile { @@ -84,7 +83,7 @@ int main(int argc,char **argv) int currentline = 1; int i, j, line, tline; - + inc.clear(); poms.sprintf("%s", argv[1]); i = poms.findRev('/', poms.length() - 1, FALSE); @@ -128,7 +127,7 @@ int main(int argc,char **argv) } if (!srcfile.open(IO_ReadOnly)) { - fprintf(stdout, "Cannot open file\n"); + fprintf(stdout, "Cannot open file: %s\n", srcfile.fileName().toStdString().c_str()); exit(1); } @@ -202,7 +201,12 @@ int main(int argc,char **argv) unlink(poms1.toStdString().c_str()); } } else { - fprintf(stdout, "Errors\n"); + QString errors; + errors.sprintf("Errors: %s does not exists, current path: %s\n", + poms.toStdString().c_str(), + QDir::currentPath().toStdString().c_str() + ); + fprintf(stdout, errors.toStdString().c_str()); poms.sprintf("%s/.cmp00", mydir); QFile err(poms.toStdString().c_str()); -- 2.30.2