[BACK]Return to lprint.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / finger

Diff for /src/usr.bin/finger/lprint.c between version 1.10 and 1.11

version 1.10, 2009/10/27 23:59:38 version 1.11, 2014/10/17 20:19:15
Line 78 
Line 78 
         struct tm *tp;          struct tm *tp;
         int oddfield;          int oddfield;
         char *t, *tzn;          char *t, *tzn;
         struct storage *mem = NULL;  
   
         cpr = 0;          cpr = 0;
         /*          /*
Line 91 
Line 90 
          *      mail status           *      mail status
          */           */
         (void)printf("Login: %-15s\t\t\tName: %s\nDirectory: %-25s",          (void)printf("Login: %-15s\t\t\tName: %s\nDirectory: %-25s",
             vs(&mem, pn->name), vs(&mem, pn->realname), pn->dir);              pn->name, pn->realname, pn->dir);
         (void)printf("\tShell: %-s\n", *pn->shell ? pn->shell : _PATH_BSHELL);          (void)printf("\tShell: %-s\n", *pn->shell ? pn->shell : _PATH_BSHELL);
   
         /*          /*
Line 104 
Line 103 
         if (pn->office && pn->officephone &&          if (pn->office && pn->officephone &&
             strlen(pn->office) + strlen(pn->officephone) +              strlen(pn->office) + strlen(pn->officephone) +
             sizeof(OFFICE_TAG) + 2 <= 5 * TAB_LEN) {              sizeof(OFFICE_TAG) + 2 <= 5 * TAB_LEN) {
                 (void)snprintf(tbuf, sizeof(tbuf),                  (void)snprintf(tbuf, sizeof(tbuf), "%s: %s, %s",
                     "%s: %s, %s", OFFICE_TAG, vs(&mem, pn->office),                      OFFICE_TAG, pn->office, prphone(pn->officephone));
                     vs(&mem, prphone(pn->officephone)));  
                 oddfield = demi_print(tbuf, oddfield);                  oddfield = demi_print(tbuf, oddfield);
         } else {          } else {
                 if (pn->office) {                  if (pn->office) {
                         (void)snprintf(tbuf, sizeof(tbuf),                          (void)snprintf(tbuf, sizeof(tbuf), "%s: %s",
                             "%s: %s", OFFICE_TAG, vs(&mem, pn->office));                              OFFICE_TAG, pn->office);
                         oddfield = demi_print(tbuf, oddfield);                          oddfield = demi_print(tbuf, oddfield);
                 }                  }
                 if (pn->officephone) {                  if (pn->officephone) {
                         (void)snprintf(tbuf, sizeof(tbuf),                          (void)snprintf(tbuf, sizeof(tbuf), "%s: %s",
                             "%s: %s", OFFICE_PHONE_TAG,                              OFFICE_PHONE_TAG, prphone(pn->officephone));
                             vs(&mem, prphone(pn->officephone)));  
                         oddfield = demi_print(tbuf, oddfield);                          oddfield = demi_print(tbuf, oddfield);
                 }                  }
         }          }
         if (pn->homephone) {          if (pn->homephone) {
                 (void)snprintf(tbuf, sizeof(tbuf), "%s: %s", "Home Phone",                  (void)snprintf(tbuf, sizeof(tbuf), "%s: %s",
                     vs(&mem, prphone(pn->homephone)));                      "Home Phone", prphone(pn->homephone));
                 oddfield = demi_print(tbuf, oddfield);                  oddfield = demi_print(tbuf, oddfield);
         }          }
         free_storage(mem);  
         if (oddfield)          if (oddfield)
                 putchar('\n');                  putchar('\n');
   

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11