projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BSD 4_3 release
[unix-history]
/
usr
/
src
/
sys
/
stand
/
prf.c
diff --git
a/usr/src/sys/stand/prf.c
b/usr/src/sys/stand/prf.c
index
1ef62e7
..
81dc158
100644
(file)
--- a/
usr/src/sys/stand/prf.c
+++ b/
usr/src/sys/stand/prf.c
@@
-1,4
+1,10
@@
-/* prf.c 6.1 83/07/29 */
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ * @(#)prf.c 7.1 (Berkeley) 6/5/86
+ */
#include "../h/param.h"
#include "../h/param.h"
@@
-77,11
+83,9
@@
number:
printn((u_long)b, *s++);
any = 0;
if (b) {
printn((u_long)b, *s++);
any = 0;
if (b) {
- putchar('<');
while (i = *s++) {
if (b & (1 << (i-1))) {
while (i = *s++) {
if (b & (1 << (i-1))) {
- if (any)
- putchar(',');
+ putchar(any? ',' : '<');
any = 1;
for (; (c = *s) > 32; s++)
putchar(c);
any = 1;
for (; (c = *s) > 32; s++)
putchar(c);
@@
-89,7
+93,8
@@
number:
for (; *s > 32; s++)
;
}
for (; *s > 32; s++)
;
}
- putchar('>');
+ if (any)
+ putchar('>');
}
break;
}
break;
@@
-129,12
+134,6
@@
printn(n, b)
/*
* Print a character on console.
/*
* Print a character on console.
- * Attempts to save and restore device
- * status.
- *
- * Whether or not printing is inhibited,
- * the last MSGBUFS characters
- * are saved in msgbuf for inspection later.
*/
putchar(c)
register c;
*/
putchar(c)
register c;
@@
-182,7
+181,6
@@
gets(buf)
lp = buf;
for (;;) {
c = getchar() & 0177;
lp = buf;
for (;;) {
c = getchar() & 0177;
- store:
switch(c) {
case '\n':
case '\r':
switch(c) {
case '\n':
case '\r':
@@
-190,7
+188,14
@@
gets(buf)
*lp++ = '\0';
return;
case '\b':
*lp++ = '\0';
return;
case '\b':
+ if (lp > buf) {
+ lp--;
+ putchar(' ');
+ putchar('\b');
+ }
+ continue;
case '#':
case '#':
+ case '\177':
lp--;
if (lp < buf)
lp = buf;
lp--;
if (lp < buf)
lp = buf;