diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-12-04 10:53:03 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2001-12-04 10:53:03 +0000 |
commit | b06dbf62ce5079af010dcbd42a1e73101079e746 (patch) | |
tree | 82d2df518abe9515a60dabe49e656eb9d051e5ae /src/util/ParseFile.c | |
parent | 8d532a917cedb5e0af9f623c273265939fbda01d (diff) |
Fixes for Cactus/833,828,825
Parsing errors from Parameter file are fatal errors
Report all parameter errors before terminating simulation (actually
this isn't quite true, it will report all parsing errors and then stop if
necessary and
then report all parameter setting errors and stop if necessary)
In parsing the parameter file omitting the
"=" and ommiting the "= value" are fatal errors.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2478 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/util/ParseFile.c')
-rw-r--r-- | src/util/ParseFile.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/util/ParseFile.c b/src/util/ParseFile.c index f484ded4..f09aa2d1 100644 --- a/src/util/ParseFile.c +++ b/src/util/ParseFile.c @@ -134,7 +134,9 @@ int ParseFile(FILE *ifp, EOF. See man 3 fgetc */ int c; + int num_errors; /* number of errors in file parsing */ + num_errors = 0; /* avoid compiler warning about unused parameter */ ConfigData = ConfigData; @@ -174,6 +176,7 @@ int ParseFile(FILE *ifp, if(intoken) { fprintf(stderr, "Parse error at line %d. No value supplied.\n", lineno); + num_errors++; intoken = 0; } @@ -367,7 +370,7 @@ int ParseFile(FILE *ifp, { value[pp++] = c; CheckBuf(pp,lineno); - } + } if (c == ',') ncommas ++; c = fgetc(ifp); #ifdef DEBUG @@ -477,7 +480,7 @@ int ParseFile(FILE *ifp, /* deallocate parse buffers */ free (tokens); - return 0; + return num_errors; } /******************************************************************** |