=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/error/Attic/main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/error/Attic/main.c 1996/06/26 05:32:44 1.2 --- src/usr.bin/error/Attic/main.c 1998/07/10 14:09:55 1.3 *************** *** 1,4 **** ! /* $OpenBSD: main.c,v 1.2 1996/06/26 05:32:44 deraadt Exp $ */ /* $NetBSD: main.c,v 1.3 1995/09/02 06:15:37 jtc Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: main.c,v 1.3 1998/07/10 14:09:55 mickey Exp $ */ /* $NetBSD: main.c,v 1.3 1995/09/02 06:15:37 jtc Exp $ */ /* *************** *** 44,50 **** #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: main.c,v 1.2 1996/06/26 05:32:44 deraadt Exp $"; #endif /* not lint */ #include --- 44,50 ---- #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: main.c,v 1.3 1998/07/10 14:09:55 mickey Exp $"; #endif /* not lint */ #include *************** *** 65,71 **** int language = INCC; char *currentfilename = "????"; - char *processname; char im_on[] = _PATH_TTY; /* my tty name */ boolean query = FALSE; /* query the operator if touch files */ --- 65,70 ---- *************** *** 133,146 **** boolean pr_summary = FALSE; boolean edit_files = FALSE; - processname = argv[0]; - errorfile = stdin; if (argc > 1) for(; (argc > 1) && (argv[1][0] == '-'); argc--, argv++){ for (cp = argv[1] + 1; *cp; cp++) switch(*cp){ default: ! fprintf(stderr, "%s: -%c: Unknown flag\n", ! processname, *cp); break; case 'n': notouch = TRUE; break; --- 132,142 ---- boolean pr_summary = FALSE; boolean edit_files = FALSE; errorfile = stdin; if (argc > 1) for(; (argc > 1) && (argv[1][0] == '-'); argc--, argv++){ for (cp = argv[1] + 1; *cp; cp++) switch(*cp){ default: ! errx(1, "-%c: Unknown flag", *cp); break; case 'n': notouch = TRUE; break; *************** *** 165,186 **** if (notouch) suffixlist = 0; if (argc > 1){ ! if (argc > 3){ ! fprintf(stderr, "%s: Only takes 0 or 1 arguments\n", ! processname); ! exit(3); ! } ! if ( (errorfile = fopen(argv[1], "r")) == NULL){ ! fprintf(stderr, "%s: %s: No such file or directory for reading errors.\n", ! processname, argv[1]); ! exit(4); ! } } if ( (queryfile = fopen(im_on, "r")) == NULL){ if (query){ ! fprintf(stderr, ! "%s: Can't open \"%s\" to query the user.\n", ! processname, im_on); exit(9); } } --- 161,174 ---- if (notouch) suffixlist = 0; if (argc > 1){ ! if (argc > 3) ! errx(3, "Only takes 0 or 1 arguments\n"); ! if ( (errorfile = fopen(argv[1], "r")) == NULL) ! err(4, argv[1]); } if ( (queryfile = fopen(im_on, "r")) == NULL){ if (query){ ! errx(9, "Can't open \"%s\" to query the user.", im_on); exit(9); } }