From 4f24a06f0e06ea420ef6ec995ed86260aba8749a Mon Sep 17 00:00:00 2001 From: Greg King Date: Sat, 12 Oct 2019 07:59:49 -0400 Subject: [PATCH] Fixed error handling for missing names in ld65 configure files. --- src/ld65/scanner.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ld65/scanner.c b/src/ld65/scanner.c index 31f1c7a41..d6278abbd 100644 --- a/src/ld65/scanner.c +++ b/src/ld65/scanner.c @@ -490,7 +490,6 @@ void CfgSpecialToken (const IdentTok* Table, unsigned Size, const char* Name) /* We need an identifier */ if (CfgTok == CFGTOK_IDENT) { - /* Make it upper case */ SB_ToUpper (&CfgSVal); @@ -502,10 +501,13 @@ void CfgSpecialToken (const IdentTok* Table, unsigned Size, const char* Name) } } + /* Not found */ + CfgError (&CfgErrorPos, "%s expected, got '%s'", Name, SB_GetConstBuf(&CfgSVal)); + return; } - /* Not found or no identifier */ - CfgError (&CfgErrorPos, "%s expected, got '%s'", Name, SB_GetConstBuf(&CfgSVal)); + /* No identifier */ + CfgError (&CfgErrorPos, "%s expected", Name); }