aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortedu <tedu>2015-11-04 21:28:01 +0000
committertedu <tedu>2015-11-04 21:28:01 +0000
commit46ef23f299464049c8b95c31b0e40221b248dc9b (patch)
tree31c0b5f0bb7e392ae0d8b9cac81ca8bdeb46d35f
parentd990eb6608a8536cf5cdd704ee89090f3143fb49 (diff)
downloadcat-46ef23f299464049c8b95c31b0e40221b248dc9b.tar
cat-46ef23f299464049c8b95c31b0e40221b248dc9b.tar.gz
replace setbuf with setvbuf, from Frederic Nowak
-rw-r--r--cat.14
-rw-r--r--cat.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/cat.1 b/cat.1
index ba62547..f874f58 100644
--- a/cat.1
+++ b/cat.1
@@ -82,7 +82,7 @@ option and also prints tab characters as
.Ql ^I .
.It Fl u
The output is guaranteed to be unbuffered (see
-.Xr setbuf 3 ) .
+.Xr setvbuf 3 ) .
.It Fl v
Displays non-printing characters so they are visible.
Control characters print as
@@ -149,7 +149,7 @@ operand.
.Xr sh 1 ,
.Xr tail 1 ,
.Xr vis 1 ,
-.Xr setbuf 3
+.Xr setvbuf 3
.Rs
.%A Rob Pike
.%T "UNIX Style, or cat -v Considered Harmful"
diff --git a/cat.c b/cat.c
index 68358de..8d6f0b6 100644
--- a/cat.c
+++ b/cat.c
@@ -87,7 +87,7 @@ main(int argc, char *argv[])
tflag = vflag = 1; /* -t implies -v */
break;
case 'u':
- setbuf(stdout, NULL);
+ setvbuf(stdout, NULL, _IONBF, 0);
break;
case 'v':
vflag = 1;