From 3ca58e13dcba212bcd024ab172b09bfa712854fb Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Sun, 14 Mar 2021 18:52:16 +0100 Subject: [PATCH] Fix verbose messages claiming non-existent errors They were confusing when trying to debug other things --- src/asm/lexer.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/asm/lexer.c b/src/asm/lexer.c index 97d5d6cf..dd3768c0 100644 --- a/src/asm/lexer.c +++ b/src/asm/lexer.c @@ -504,9 +504,15 @@ struct LexerState *lexer_OpenFile(char const *path) } if (!state->isMmapped) { /* Sometimes mmap() fails or isn't available, so have a fallback */ - if (verbose) - printf("File %s opened as regular, errno reports \"%s\"\n", - path, strerror(errno)); + if (verbose) { + if (isStdin) + printf("Opening stdin\n"); + else if (fileInfo.st_size == 0) + printf("File %s is empty\n", path); + else + printf("File %s opened as regular, errno reports \"%s\"\n", + path, strerror(errno)); + } state->index = 0; state->nbChars = 0; }