-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 <stdio.h>
#include <ctype.h>
#include <signal.h>
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 */
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){
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);