don't call setbuf.
authorRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Tue, 18 Sep 1984 01:58:05 +0000 (17:58 -0800)
committerRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Tue, 18 Sep 1984 01:58:05 +0000 (17:58 -0800)
SCCS-vsn: usr.bin/grep/old.ucb.grep/old.ucb.grep.c 4.4
SCCS-vsn: usr.bin/colcrt/colcrt.c 4.4
SCCS-vsn: usr.bin/expand/expand.c 4.3
SCCS-vsn: usr.bin/finger/finger.c 4.8
SCCS-vsn: usr.bin/fold/fold.c 4.3
SCCS-vsn: usr.bin/head/head.c 4.2
SCCS-vsn: usr.bin/ul/ul.c 4.6
SCCS-vsn: usr.bin/w/w.c 4.13
SCCS-vsn: old/dbx/main.c 1.9
SCCS-vsn: old/dbx/main.c 1.9

usr/src/old/dbx/main.c
usr/src/usr.bin/colcrt/colcrt.c
usr/src/usr.bin/expand/expand.c
usr/src/usr.bin/finger/finger.c
usr/src/usr.bin/fold/fold.c
usr/src/usr.bin/grep/old.ucb.grep/old.ucb.grep.c
usr/src/usr.bin/head/head.c
usr/src/usr.bin/ul/ul.c
usr/src/usr.bin/w/w.c

index bab6690..dacc89b 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1982 Regents of the University of California */
 
 /* Copyright (c) 1982 Regents of the University of California */
 
-static char sccsid[] = "@(#)main.c     1.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     1.9 (Berkeley) %G%";
 
 /*
  * Debugger main routine.
 
 /*
  * Debugger main routine.
@@ -44,7 +44,6 @@ public File corefile;                 /* File id of core dump */
 
 private Boolean initdone = false;      /* true if initialization done */
 private jmp_buf env;                   /* setjmp/longjmp data */
 
 private Boolean initdone = false;      /* true if initialization done */
 private jmp_buf env;                   /* setjmp/longjmp data */
-private char outbuf[BUFSIZ];           /* standard output buffer */
 private char namebuf[512];             /* possible name of object file */
 private int firstarg;                  /* first program argument (for -r) */
 
 private char namebuf[512];             /* possible name of object file */
 private int firstarg;                  /* first program argument (for -r) */
 
@@ -67,7 +66,6 @@ String argv[];
     cmdname = argv[0];
     catcherrs();
     onsyserr(EINTR, nil);
     cmdname = argv[0];
     catcherrs();
     onsyserr(EINTR, nil);
-    setbuf(stdout, outbuf);
     setlinebuf(stderr);
     printf("dbx version %d of %s.\nType 'help' for help.\n",
        versionNumber, date);
     setlinebuf(stderr);
     printf("dbx version %d of %s.\nType 'help' for help.\n",
        versionNumber, date);
index 108fa61..ddee9d7 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)colcrt.c    4.3 (Berkeley) %G%";
+static char *sccsid = "@(#)colcrt.c    4.4 (Berkeley) %G%";
 
 #include <stdio.h>
 /*
 
 #include <stdio.h>
 /*
@@ -20,7 +20,6 @@ char  page[267][132];
 int    outline = 1;
 int    outcol;
 
 int    outline = 1;
 int    outcol;
 
-char   buf[BUFSIZ];
 char   suppresul;
 char   printall;
 
 char   suppresul;
 char   printall;
 
@@ -52,7 +51,6 @@ main(argc, argv)
                argc--;
                argv++;
        }
                argc--;
                argv++;
        }
-       setbuf(stdout, buf);
        do {
                if (argc > 0) {
                        close(0);
        do {
                if (argc > 0) {
                        close(0);
@@ -60,7 +58,6 @@ main(argc, argv)
 ) < 0) {
                                fflush(stdout);
                                perror(argv[0]);
 ) < 0) {
                                fflush(stdout);
                                perror(argv[0]);
-                               fflush(stdout);
                                exit (1);
                        }
                        argc--;
                                exit (1);
                        }
                        argc--;
index f61833d..7c3cdb0 100644 (file)
@@ -1,9 +1,8 @@
-static char *sccsid = "@(#)expand.c    4.2 (Berkeley) %G%";
+static char *sccsid = "@(#)expand.c    4.3 (Berkeley) %G%";
 #include <stdio.h>
 /*
  * expand - expand tabs to equivalent spaces
  */
 #include <stdio.h>
 /*
  * expand - expand tabs to equivalent spaces
  */
-char   obuf[BUFSIZ];
 int    nstops;
 int    tabstops[100];
 
 int    nstops;
 int    tabstops[100];
 
@@ -14,7 +13,6 @@ main(argc, argv)
        register int c, column;
        register int n;
 
        register int c, column;
        register int n;
 
-       setbuf(stdout, obuf);
        argc--, argv++;
        do {
                while (argc > 0 && argv[0][0] == '-') {
        argc--, argv++;
        do {
                while (argc > 0 && argv[0][0] == '-') {
index 8d87438..bd6c8a8 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)finger.c    4.7 (Berkeley) %G%";
+static char *sccsid = "@(#)finger.c    4.8 (Berkeley) %G%";
 #endif
 
 /*  This is a finger program.  It prints out useful information about users
 #endif
 
 /*  This is a finger program.  It prints out useful information about users
@@ -92,7 +92,6 @@ int           pwdsize         = sizeof( struct passwd );
 
 char           LASTLOG[]       = "/usr/adm/lastlog";   /* last login info */
 char           USERLOG[]       = "/etc/utmp";          /* who is logged in */
 
 char           LASTLOG[]       = "/usr/adm/lastlog";   /* last login info */
 char           USERLOG[]       = "/etc/utmp";          /* who is logged in */
-char           outbuf[BUFSIZ];                         /* output buffer */
 char           *ctime(), *strcpy();
 
 int            unbrief         = 1;            /* -b option default */
 char           *ctime(), *strcpy();
 
 int            unbrief         = 1;            /* -b option default */
@@ -139,9 +138,7 @@ main( argc, argv )
        int                     i, j;
        int                     fngrlogin;
 
        int                     i, j;
        int                     fngrlogin;
 
-       setbuf( stdout, outbuf );                       /* buffer output */
-
-    /*  parse command line for (optional) arguments */
+       /*  parse command line for (optional) arguments */
 
        i = 1;
        if(  strcmp( *argv, "sh" )  )  {
 
        i = 1;
        if(  strcmp( *argv, "sh" )  )  {
index 9d1dc7b..191c04b 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)fold.c      4.2 (Berkeley) %G%";
+static char *sccsid = "@(#)fold.c      4.3 (Berkeley) %G%";
 #include <stdio.h>
 /*
  * fold - fold long lines for finite output devices
 #include <stdio.h>
 /*
  * fold - fold long lines for finite output devices
@@ -14,10 +14,8 @@ main(argc, argv)
 {
        register c;
        FILE *f;
 {
        register c;
        FILE *f;
-       char obuf[BUFSIZ];
 
        argc--, argv++;
 
        argc--, argv++;
-       setbuf(stdout, obuf);
        if (argc > 0 && argv[0][0] == '-') {
                fold = 0;
                argv[0]++;
        if (argc > 0 && argv[0][0] == '-') {
                fold = 0;
                argv[0]++;
index e016f4f..154c182 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)old.ucb.grep.c     4.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)old.ucb.grep.c     4.4 (Berkeley) %G%";
 #endif
 
 #include <stdio.h>
 #endif
 
 #include <stdio.h>
@@ -42,9 +42,7 @@ long  tln;
 main(argc, argv)
 char **argv;
 {
 main(argc, argv)
 char **argv;
 {
-       char obuf[BUFSIZ];
 
 
-       setbuf(stdout, obuf);
        while (--argc > 0 && (++argv)[0][0]=='-') {
                char *cp = argv[0] + 1;
                while (*cp) switch (*cp++) {
        while (--argc > 0 && (++argv)[0][0]=='-') {
                char *cp = argv[0] + 1;
                while (*cp) switch (*cp++) {
index 1c7ff67..b80d94d 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)head.c      4.1 (Berkeley) %G%";
+static char *sccsid = "@(#)head.c      4.2 (Berkeley) %G%";
 #include <stdio.h>
 /*
  * head - give the first few lines of a stream or of each of a set of files
 #include <stdio.h>
 /*
  * head - give the first few lines of a stream or of each of a set of files
@@ -17,9 +17,7 @@ main(Argc, argv)
        char *name;
        register char *argp;
        static int around;
        char *name;
        register char *argp;
        static int around;
-       char obuf[BUFSIZ];
 
 
-       setbuf(stdout, obuf);
        Argc--, argv++;
        argc = Argc;
        do {
        Argc--, argv++;
        argc = Argc;
        do {
index 826993d..a8e8252 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)ul.c       4.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)ul.c       4.6 (Berkeley) %G%";
 #endif
 
 #include <stdio.h>
 #endif
 
 #include <stdio.h>
@@ -29,8 +29,6 @@ struct        CHAR    {
        char    c_char;
 } ;
 
        char    c_char;
 } ;
 
-char   buf[BUFSIZ];
-
 struct CHAR    obuf[MAXBUF];
 int    col, maxcol;
 int    mode;
 struct CHAR    obuf[MAXBUF];
 int    col, maxcol;
 int    mode;
@@ -89,7 +87,6 @@ main(argc, argv)
        if (    (tgetflag("os") && ENTER_BOLD==NULL ) ||
                (tgetflag("ul") && ENTER_UNDERLINE==NULL && UNDER_CHAR==NULL))
                        must_overstrike = 1;
        if (    (tgetflag("os") && ENTER_BOLD==NULL ) ||
                (tgetflag("ul") && ENTER_UNDERLINE==NULL && UNDER_CHAR==NULL))
                        must_overstrike = 1;
-       setbuf(stdout, buf);
        initbuf();
        if (optind == argc)
                filter(stdin);
        initbuf();
        if (optind == argc)
                filter(stdin);
index b6a3fca..b467290 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)w.c 4.12 (Berkeley) %G%";
+static char *sccsid = "@(#)w.c 4.13 (Berkeley) %G%";
 #endif
 /*
  * w - print system status (who and what)
 #endif
 /*
  * w - print system status (who and what)
@@ -117,9 +117,7 @@ main(argc, argv)
        register int i, j;
        char *cp;
        register int curpid, empty;
        register int i, j;
        char *cp;
        register int curpid, empty;
-       char obuf[BUFSIZ];
 
 
-       setbuf(stdout, obuf);
        login = (argv[0][0] == '-');
        cp = rindex(argv[0], '/');
        firstchar = login ? argv[0][1] : (cp==0) ? argv[0][0] : cp[1];
        login = (argv[0][0] == '-');
        cp = rindex(argv[0], '/');
        firstchar = login ? argv[0][1] : (cp==0) ? argv[0][0] : cp[1];