Module Name: src Committed By: rillig Date: Sun Aug 8 15:29:24 UTC 2021
Modified Files: src/usr.bin/xlint/xlint: lint.1 xlint.c Log Message: lint: remove dead code for reading from stdin Since xlint.c 1.27 from 2002-01-31, it has not been possible to read from stdin anymore. Apparently nobody missed this feature in the last 19 years. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/usr.bin/xlint/xlint/lint.1 cvs rdiff -u -r1.68 -r1.69 src/usr.bin/xlint/xlint/xlint.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/xlint/xlint/lint.1 diff -u src/usr.bin/xlint/xlint/lint.1:1.44 src/usr.bin/xlint/xlint/lint.1:1.45 --- src/usr.bin/xlint/xlint/lint.1:1.44 Sun May 2 21:05:42 2021 +++ src/usr.bin/xlint/xlint/lint.1 Sun Aug 8 15:29:24 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: lint.1,v 1.44 2021/05/02 21:05:42 rillig Exp $ +.\" $NetBSD: lint.1,v 1.45 2021/08/08 15:29:24 rillig Exp $ .\" .\" Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. .\" Copyright (c) 1994, 1995 Jochen Pohl @@ -167,22 +167,6 @@ At this point, if a complaint stems not but from one of its included files, the source filename will be printed followed by a question mark. .Pp -The special input file name -.Dq Pa - -causes -.Nm -to take input from standard input (until end of file) and process -it as if it were a -.Pa \&.c -file. -If the -.Fl i -flag is given and -.Dq Pa - -is named as one of the input files, the -.Fl o -flag must also be specified to provide an output file name. -.Pp .Sy Options .Bl -tag -width XoXoutputfileXXX .It Fl Ac11 Index: src/usr.bin/xlint/xlint/xlint.c diff -u src/usr.bin/xlint/xlint/xlint.c:1.68 src/usr.bin/xlint/xlint/xlint.c:1.69 --- src/usr.bin/xlint/xlint/xlint.c:1.68 Sun Aug 8 15:06:44 2021 +++ src/usr.bin/xlint/xlint/xlint.c Sun Aug 8 15:29:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: xlint.c,v 1.68 2021/08/08 15:06:44 rillig Exp $ */ +/* $NetBSD: xlint.c,v 1.69 2021/08/08 15:29:24 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: xlint.c,v 1.68 2021/08/08 15:06:44 rillig Exp $"); +__RCSID("$NetBSD: xlint.c,v 1.69 2021/08/08 15:29:24 rillig Exp $"); #endif #include <sys/param.h> @@ -634,10 +634,8 @@ fname(const char *name) char **args, *ofn, *pathname; const char *CC; size_t len; - bool is_stdin; int fd; - is_stdin = strcmp(name, "-") == 0; bn = lbasename(name, '/'); suff = lbasename(bn, '.'); @@ -648,15 +646,14 @@ fname(const char *name) return; } - if (!is_stdin && strcmp(suff, "c") != 0 && + if (strcmp(suff, "c") != 0 && (strncmp(bn, "llib-l", 6) != 0 || bn != suff)) { warnx("unknown file type: %s", name); return; } if (!iflag || !first) - (void)printf("%s:\n", - is_stdin ? "{standard input}" : Fflag ? name : bn); + (void)printf("%s:\n", Fflag ? name : bn); /* build the name of the output file of lint1 */ if (oflag) { @@ -664,10 +661,6 @@ fname(const char *name) outputfn = NULL; oflag = false; } else if (iflag) { - if (is_stdin) { - warnx("-i not supported without -o for standard input"); - return; - } len = bn == suff ? strlen(bn) : (size_t)((suff - 1) - bn); ofn = xasprintf("%.*s.ln", (int)len, bn); } else {