]> andersk Git - moira.git/commitdiff
Convert full name to a reasonable format.
authorzacheiss <zacheiss>
Fri, 16 Mar 2001 20:18:18 +0000 (20:18 +0000)
committerzacheiss <zacheiss>
Fri, 16 Mar 2001 20:18:18 +0000 (20:18 +0000)
regtape/staff.pc

index a636b2f17989b70e16873dab6c1ab18443d15c89..8edf98ac71dd9f221b7696405dd6e07f835455ac 100644 (file)
@@ -137,7 +137,7 @@ struct entry *get_next_entry(FILE *in)
 {
   static struct entry e;
   static char buf[BUFSIZ];
-  static char name[LEN_NAME + 1], sname[LEN_NAME + 1], id[LEN_ID + 1];
+  static char name[LEN_NAME + 1], id[LEN_ID + 1];
   static char office[LEN_OFFICE + 1], phone[LEN_PHONE + 1];
   static char phone2[LEN_PHONE2 + 1], dept[LEN_DEPT + 1], title[LEN_TITLE + 1];
   int ends_sr, ends_jr, ends_iii, ends_iv, ends_ii, ends_v;
@@ -154,8 +154,6 @@ struct entry *get_next_entry(FILE *in)
   strlcpy(dept, &buf[LOC_DEPT], LEN_DEPT + 1);
   strlcpy(title, &buf[LOC_TITLE], LEN_TITLE + 1);
 
-  strcpy(sname, name);
-  e.name = strtrim(sname);
   p = strchr(name, ',');
   if (p)
     *p = '\0';
@@ -195,6 +193,12 @@ struct entry *get_next_entry(FILE *in)
   FixCase(e.first);
   FixCase(e.middle);
 
+  e.name = buf;
+  if (*e.middle)
+    sprintf(e.name, "%s %s %s", e.first, e.middle, e.last);
+  else
+    sprintf(e.name, "%s %s", e.first, e.last);
+
   e.id = id;
   e.haddr = e.hphone = "";
 
This page took 0.031859 seconds and 5 git commands to generate.