Allow rgbasm and rgblink to use stdout and stdin as input and output

This commit is contained in:
Daid
2020-10-26 20:28:15 +01:00
parent 0c55703438
commit 7e620bff81
2 changed files with 15 additions and 2 deletions

View File

@@ -471,7 +471,12 @@ static void registerExportedSymbol(struct Symbol *symbol, void *arg)
*/
void out_WriteObject(void)
{
FILE *f = fopen(tzObjectname, "wb");
FILE *f;
if (strcmp(tzObjectname, "-") != 0) {
f = fopen(tzObjectname, "wb");
} else {
f = fdopen(1, "wb");
}
if (!f)
err(1, "Couldn't write file '%s'", tzObjectname);