xvsprintf (Buf, sizeof (Buf), Format, ap);
va_end (ap);
- Warning ("%s(%u): %s", CfgName, CfgErrorLine, Buf);
+ Warning ("%s(%u): %s", CfgGetName(), CfgErrorLine, Buf);
}
xvsprintf (Buf, sizeof (Buf), Format, ap);
va_end (ap);
- Error ("%s(%u): %s", CfgName, CfgErrorLine, Buf);
+ Error ("%s(%u): %s", CfgGetName(), CfgErrorLine, Buf);
}
/* Read from buffer */
C = (unsigned char)(*CfgBuf);
if (C == 0) {
- C = EOF;
+ C = EOF;
} else {
++CfgBuf;
}
case ':':
NextChar ();
CfgTok = CFGTOK_COLON;
- break;
+ break;
case '\"':
NextChar ();
CfgSVal [0] = '\0';
}
CfgTok = CFGTOK_STRCON;
- break;
+ break;
case 'S':
NextChar ();
/* Linear search */
for (I = 0; I < Size; ++I) {
- if (strcmp (CfgSVal, Table [I].Ident) == 0) {
+ if (strcmp (CfgSVal, Table [I].Ident) == 0) {
CfgTok = Table [I].Tok;
return;
}
const char* CfgGetName (void)
/* Get the name of the config file */
{
- return CfgName? CfgName : "";
+ if (CfgName) {
+ return CfgName;
+ } else if (CfgBuf) {
+ return "[builtin config]";
+ } else {
+ return "";
+ }
}
/* Initialize variables */
C = ' ';
- InputLine = 1;
+ InputLine = 1;
InputCol = 0;
/* Start the ball rolling ... */
-
+