#define LEN_ID 9
#define LEN_NAME 30
-#define LEN_OFFICE 23
+#define LEN_OFFICE 12
#define LEN_PHONE 12
#define LEN_PHONE2 12
#define LEN_DEPT 19
{
static struct entry e;
static char buf[BUFSIZ], mid[16], eid[16], email[256], phone[13];
- int ends_jr, ends_iii, ends_iv;
+ int ends_sr, ends_jr, ends_iii, ends_iv;
char *p;
- fgets(buf, sizeof(buf), in);
+ if (fgets(buf, sizeof(buf), in) == NULL)
+ return((struct entry *)NULL);
buf[LEN_NAME] = 0;
p = index(&buf[LOC_NAME], ',');
if (p)
} else
e.first = "";
e.first = strtrim(e.first);
- ends_jr = ends_iii = ends_iv = 0;
+ ends_sr = ends_jr = ends_iii = ends_iv = 0;
LookForSt(e.last);
LookForO(e.last);
- LookForJrAndIII(e.last, &ends_jr, &ends_iii, &ends_iv);
- LookForJrAndIII(e.first, &ends_jr, &ends_iii, &ends_iv);
+ LookForJrAndIII(e.last, &ends_sr, &ends_jr, &ends_iii, &ends_iv);
+ LookForJrAndIII(e.first, &ends_sr, &ends_jr, &ends_iii, &ends_iv);
FixCase(e.last);
FixCase(e.first);
FixCase(e.middle);
newuser(e);
return;
}
- if (strcmp(e->class, strtrim(class))) {
+ if (strcmp(e->class, strtrim(class)) && strcmp(class, "STAFF")) {
com_err(whoami, 0, "updating class for %s %s from %s to %s",
first, last, class, e->class);
strcpy(class, e->class);
## repeat replace u (mit_year = @class,
## modtime = "now", modby = WHO, modwith = PROG)
-## where u.users_id = id
+## where u.users_id = @id
}
changed = nochange = 0;
strcpy(buf, e->address);