Deleted Added
full compact
lprint.c (1591) lprint.c (2537)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Tony Nardo of the Johns Hopkins University/Applied Physics Lab.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 99 unchanged lines hidden (view full) ---

108
109 /*
110 * long format --
111 * login name
112 * real name
113 * home directory
114 * shell
115 * office, office phone, home phone if available
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Tony Nardo of the Johns Hopkins University/Applied Physics Lab.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 99 unchanged lines hidden (view full) ---

108
109 /*
110 * long format --
111 * login name
112 * real name
113 * home directory
114 * shell
115 * office, office phone, home phone if available
116 * mail status
116 */
117 (void)printf("Login: %-15s\t\t\tName: %s\nDirectory: %-25s",
118 pn->name, pn->realname, pn->dir);
119 (void)printf("\tShell: %-s\n", *pn->shell ? pn->shell : _PATH_BSHELL);
120
121 /*
122 * try and print office, office phone, and home phone on one line;
123 * if that fails, do line filling so it looks nice.

--- 23 unchanged lines hidden (view full) ---

147 (void)snprintf(tbuf, sizeof(tbuf), "%s: %s", "Home Phone",
148 prphone(pn->homephone));
149 oddfield = demi_print(tbuf, oddfield);
150 }
151 if (oddfield)
152 putchar('\n');
153
154 /*
117 */
118 (void)printf("Login: %-15s\t\t\tName: %s\nDirectory: %-25s",
119 pn->name, pn->realname, pn->dir);
120 (void)printf("\tShell: %-s\n", *pn->shell ? pn->shell : _PATH_BSHELL);
121
122 /*
123 * try and print office, office phone, and home phone on one line;
124 * if that fails, do line filling so it looks nice.

--- 23 unchanged lines hidden (view full) ---

148 (void)snprintf(tbuf, sizeof(tbuf), "%s: %s", "Home Phone",
149 prphone(pn->homephone));
150 oddfield = demi_print(tbuf, oddfield);
151 }
152 if (oddfield)
153 putchar('\n');
154
155 /*
155 * long format con't: * if logged in
156 * long format con't:
157 * if logged in
156 * terminal
157 * idle time
158 * if messages allowed
159 * where logged in from
160 * if not logged in
161 * when last logged in
162 */
163 /* find out longest device name for this user for formatting */

--- 52 unchanged lines hidden (view full) ---

216 }
217 if (*w->host) {
218 if (LINE_LEN < (cpr + 6 + strlen(w->host)))
219 (void)printf("\n ");
220 (void)printf(" from %s", w->host);
221 }
222 putchar('\n');
223 }
158 * terminal
159 * idle time
160 * if messages allowed
161 * where logged in from
162 * if not logged in
163 * when last logged in
164 */
165 /* find out longest device name for this user for formatting */

--- 52 unchanged lines hidden (view full) ---

218 }
219 if (*w->host) {
220 if (LINE_LEN < (cpr + 6 + strlen(w->host)))
221 (void)printf("\n ");
222 (void)printf(" from %s", w->host);
223 }
224 putchar('\n');
225 }
226 if (pn->mailrecv == -1)
227 printf("No Mail.\n");
228 else if (pn->mailrecv > pn->mailread) {
229 tp = localtime(&pn->mailrecv);
230 t = asctime(tp);
231 tzn = tp->tm_zone;
232 printf("New mail received %.16s %.4s (%s)\n", t, t + 20, tzn);
233 tp = localtime(&pn->mailread);
234 t = asctime(tp);
235 tzn = tp->tm_zone;
236 printf(" Unread since %.16s %.4s (%s)\n", t, t + 20, tzn);
237 } else {
238 tp = localtime(&pn->mailread);
239 t = asctime(tp);
240 tzn = tp->tm_zone;
241 printf("Mail last read %.16s %.4s (%s)\n", t, t + 20, tzn);
242 }
224}
225
226static int
227demi_print(str, oddfield)
228 char *str;
229 int oddfield;
230{
231 static int lenlast;

--- 102 unchanged lines hidden ---
243}
244
245static int
246demi_print(str, oddfield)
247 char *str;
248 int oddfield;
249{
250 static int lenlast;

--- 102 unchanged lines hidden ---