F = fopen (Name, "r");
if (F == 0) {
- char* PathName;
+ char* PathName;
/* Error (fatal error if this is the main file) */
if (ICount == 0) {
/* check again if we do now have an open file */
if (F != 0) {
- unsigned FileIdx;
+ unsigned FileIdx;
/* Stat the file and remember the values */
struct stat Buf;
Fatal ("Cannot stat input file `%s': %s", Name, strerror (errno));
}
- /* Add the file to the input file table and remember the index */
- FileIdx = AddFile (Name, Buf.st_size, Buf.st_mtime);
+ /* Add the file to the input file table and remember the index */
+ FileIdx = AddFile (Name, Buf.st_size, Buf.st_mtime);
/* Create a new state variable and initialize it */
I = xmalloc (sizeof (*I));
IFile = I;
++ICount;
- /* Setup the next token and character so it will be skipped on the
- * next call to NextRawTok().
+ /* Read the first character from the new file */
+ NextChar ();
+
+ /* Setup the next token so it will be skipped on the next call to
+ * NextRawTok().
*/
- C = ' ';
Tok = TOK_SEP;
}
I->Next = IData;
IData = I;
- /* Setup the next token and character so it will be skipped on the
- * next call to NextRawTok().
+ /* Read the first character from the new file */
+ NextChar ();
+
+ /* Setup the next token so it will be skipped on the next call to
+ * NextRawTok().
*/
- C = ' ';
Tok = TOK_SEP;
}
}
++I;
- /* Skip the character */
+ /* Skip the character */
NextChar ();
}
return;
case 'X':
- Tok = TOK_X;
+ Tok = TOK_X;
return;
case 'Y':
case '-':
NextChar ();
- Tok = TOK_MINUS;
+ Tok = TOK_MINUS;
return;
case '/':
case '-':
IVal = 0;
do {
- --IVal;
+ --IVal;
NextChar ();
} while (C == '-');
Tok = TOK_ULABEL;
++IVal;
NextChar ();
} while (C == '+');
- Tok = TOK_ULABEL;
+ Tok = TOK_ULABEL;
break;
case '=':
return;
case '>':
- NextChar ();
+ NextChar ();
if (C == '=') {
NextChar ();
Tok = TOK_GE;
return;
case '\"':
- ReadStringConst ('\"');
+ ReadStringConst ('\"');
Tok = TOK_STRCON;
return;
/* If we aren't in ignore case mode, we have to uppercase the identifier */
if (!IgnoreCase) {
- UpcaseSVal ();
+ UpcaseSVal ();
}
/* Do a linear search (a binary search is not worth the effort) */
for (I = 0; I < Count; ++I) {
- if (strcmp (SVal, Keys [I]) == 0) {
- /* Found it */
- return I;
- }
+ if (strcmp (SVal, Keys [I]) == 0) {
+ /* Found it */
+ return I;
+ }
}
/* Not found */