"Cannot open input file" error message now contains file name.

git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@294 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
marcobaye 2020-08-24 16:31:36 +00:00
parent 88cc8cd886
commit d59b45036d
4 changed files with 10 additions and 5 deletions

View File

@ -33,7 +33,6 @@ char s_untitled[] = "<untitled>"; // FIXME - this is actually const
// Exception messages during assembly
const char exception_cannot_open_input_file[] = "Cannot open input file.";
const char exception_missing_string[] = "No string given.";
const char exception_negative_size[] = "Negative size argument.";
const char exception_no_left_brace[] = "Missing '{'.";

View File

@ -23,7 +23,6 @@
#define SF_IMPLIED_LABEL (1u << 1) // statement had implied label def
extern char s_untitled[];
// error messages during assembly
extern const char exception_cannot_open_input_file[];
extern const char exception_missing_string[];
extern const char exception_negative_size[];
extern const char exception_no_left_brace[];

View File

@ -737,8 +737,15 @@ FILE *includepaths_open_ro(boolean uses_lib)
}
}
}
if (stream == NULL)
Throw_error(exception_cannot_open_input_file);
if (stream == NULL) {
// CAUTION, I'm re-using the path dynabuf to assemble the error message:
DYNABUF_CLEAR(pathbuf);
DynaBuf_add_string(pathbuf, "Cannot open input file \"");
DynaBuf_add_string(pathbuf, GLOBALDYNABUF_CURRENT);
DynaBuf_add_string(pathbuf, "\".");
DynaBuf_append(pathbuf, '\0');
Throw_error(pathbuf->buffer);
}
//fprintf(stderr, "File is [%s]\n", GLOBALDYNABUF_CURRENT);
return stream;
}

View File

@ -9,7 +9,7 @@
#define RELEASE "0.97" // update before release FIXME
#define CODENAME "Zem" // update before release
#define CHANGE_DATE "20 Aug" // update before release FIXME
#define CHANGE_DATE "24 Aug" // update before release FIXME
#define CHANGE_YEAR "2020" // update before release
//#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/"
#define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME