Gives 0 a name and removes a little logic.
#define DEFAULT 1
#define LOGIN 2
#define PASSWD 3
#define DEFAULT 1
#define LOGIN 2
#define PASSWD 3
};
static struct toktab toktabs[] = {
};
static struct toktab toktabs[] = {
{ "default", DEFAULT },
{ "login", LOGIN },
{ "password", PASSWD },
{ "default", DEFAULT },
{ "login", LOGIN },
{ "password", PASSWD },
struct toktab *t;
if (feof(cfile))
struct toktab *t;
if (feof(cfile))
while ((c = getc(cfile)) != EOF &&
(c == '\n' || c == '\t' || c == ' ' || c == ','))
continue;
if (c == EOF)
while ((c = getc(cfile)) != EOF &&
(c == '\n' || c == '\t' || c == ' ' || c == ','))
continue;
if (c == EOF)
cp = tokval;
if (c == '"') {
while ((c = getc(cfile)) != EOF && c != '"') {
cp = tokval;
if (c == '"') {
while ((c = getc(cfile)) != EOF && c != '"') {
- if (tokval[0] == 0)
- return (0);
for (t = toktabs; t->tokstr; t++)
if (!strcmp(t->tokstr, tokval))
return (t->tval);
for (t = toktabs; t->tokstr; t++)
if (!strcmp(t->tokstr, tokval))
return (t->tval);