adapted for 7 character significance

This commit is contained in:
ceriel 1987-03-19 10:16:56 +00:00
parent 8829d77144
commit b86dc9f84d

View file

@ -31,8 +31,8 @@ struct outhead outhead;
struct outsect outsect[S_MAX]; struct outsect outsect[S_MAX];
char *stringarea ; char *stringarea ;
char *output_file; char *ofile;
int output_file_created; int ofile_created;
char *program ; char *program ;
@ -88,8 +88,8 @@ main(argc, argv)
case 1: break; case 1: break;
case 3: if ((output = fopen(argv[2], "w")) == (FILE *)0) case 3: if ((output = fopen(argv[2], "w")) == (FILE *)0)
fatal("Can't write %s.\n", argv[2]); fatal("Can't write %s.\n", argv[2]);
output_file = argv[2]; ofile = argv[2];
output_file_created = 1; ofile_created = 1;
/* FALLTHROUGH */ /* FALLTHROUGH */
case 2: if ((input = fopen(argv[1], "r")) == (FILE *)0) case 2: if ((input = fopen(argv[1], "r")) == (FILE *)0)
fatal("Can't read %s.\n", argv[1]); fatal("Can't read %s.\n", argv[1]);
@ -170,7 +170,7 @@ main(argc, argv)
if ( ferror(output) ) { if ( ferror(output) ) {
fatal("output write error\n") ; fatal("output write error\n") ;
} }
if ( output_file_created ) chmod(argv[2],0755); if ( ofile_created ) chmod(argv[2],0755);
return 0; return 0;
} }
@ -368,7 +368,7 @@ fatal(s, a1, a2)
{ {
fprintf(stderr,"%s: ",program) ; fprintf(stderr,"%s: ",program) ;
fprintf(stderr, s, a1, a2); fprintf(stderr, s, a1, a2);
if (output_file_created) if (ofile_created)
unlink(output_file); unlink(ofile);
exit(-1); exit(-1);
} }