X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/58195f212aa2aa92a821e0793d82e330df26e083..9c50374f0792e9289728367cb68f8e6448721f05:/usr/src/usr.bin/error/main.c?ds=inline diff --git a/usr/src/usr.bin/error/main.c b/usr/src/usr.bin/error/main.c index 36ec9e6a28..54924f67a6 100644 --- a/usr/src/usr.bin/error/main.c +++ b/usr/src/usr.bin/error/main.c @@ -1,4 +1,30 @@ -static char *sccsid = "@(#)main.c 1.3 (Berkeley) %G%"; +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef lint +char copyright[] = +"@(#) Copyright (c) 1980 Regents of the University of California.\n\ + All rights reserved.\n"; +#endif /* not lint */ + +#ifndef lint +static char sccsid[] = "@(#)main.c 5.3 (Berkeley) %G%"; +#endif /* not lint */ + #include #include #include @@ -14,7 +40,7 @@ int language = INCC; char *currentfilename = "????"; char *processname; -char *im_on; /* my tty name */ +char im_on[] = "/dev/tty"; /* my tty name */ boolean query = FALSE; /* query the operator if touch files */ boolean notouch = FALSE; /* don't touch ANY files */ @@ -97,15 +123,6 @@ main(argc, argv) case 's': pr_summary = TRUE; break; case 'v': edit_files = TRUE; break; case 'T': terse = TRUE; break; -#ifndef ERNIE - case 'p': - *cp-- = 0; argv++; argc--; - if (argc > 1){ - currentfilename = argv[1]; - piflag = TRUE; - } - break; -#endif case 't': *cp-- = 0; argv++; argc--; if (argc > 1){ @@ -133,11 +150,13 @@ main(argc, argv) exit(4); } } - im_on = "/dev/tty"; if ( (queryfile = fopen(im_on, "r")) == NULL){ - fprintf(stderr,"%s: Can't open \"%s\" to query the user.\n", - processname, im_on); - exit(9); + if (query){ + fprintf(stderr, + "%s: Can't open \"%s\" to query the user.\n", + processname, im_on); + exit(9); + } } if (signal(SIGINT, onintr) == SIG_IGN) signal(SIGINT, SIG_IGN);