=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/fmt/fmt.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- src/usr.bin/fmt/fmt.c 2004/04/01 23:14:19 1.21 +++ src/usr.bin/fmt/fmt.c 2004/06/29 16:59:46 1.22 @@ -1,4 +1,4 @@ -/* $OpenBSD: fmt.c,v 1.21 2004/04/01 23:14:19 tedu Exp $ */ +/* $OpenBSD: fmt.c,v 1.22 2004/06/29 16:59:46 mickey Exp $ */ /* Sensible version of fmt * @@ -170,7 +170,7 @@ #ifndef lint static const char rcsid[] = - "$OpenBSD: fmt.c,v 1.21 2004/04/01 23:14:19 tedu Exp $"; + "$OpenBSD: fmt.c,v 1.22 2004/06/29 16:59:46 mickey Exp $"; static const char copyright[] = "Copyright (c) 1997 Gareth McCaughan. All rights reserved.\n"; #endif /* not lint */ @@ -359,7 +359,7 @@ FILE *f; if ((f = fopen(name, "r")) == NULL) { - perror(name); + warn(name); ++n_errors; } else { process_stream(f, name); @@ -468,7 +468,7 @@ new_paragraph(output_in_paragraph ? last_indent : first_indent, 0); if (ferror(stream)) { - perror(name); + warn(name); ++n_errors; } } @@ -633,7 +633,7 @@ } if (ferror(stream)) { - perror(name); + warn(name); ++n_errors; } } @@ -708,9 +708,10 @@ void usage(void) { + extern char *__progname; fprintf(stderr, - "Usage: fmt [-cmps] [-d chars] [-l num] [-t num]\n" + "Usage: %s [-cmps] [-d chars] [-l num] [-t num]\n" " [-w width | -width | goal [maximum]] [file ...]\n" "Options: -c center each line instead of formatting\n" " -d double-space after at line end\n" @@ -721,7 +722,6 @@ " -s coalesce whitespace inside lines\n" " -t have tabs every columns\n" " -w set maximum width to \n" - " goal set target width to goal\n"); - exit (0); + " goal set target width to goal\n", __progname); + exit (1); } -