diff options
| author | Sergey Kandaurov <pluknet@FreeBSD.org> | 2014-05-04 12:20:40 +0000 |
|---|---|---|
| committer | Sergey Kandaurov <pluknet@FreeBSD.org> | 2014-05-04 12:20:40 +0000 |
| commit | c401df0176f4d72ce95f7480d718e473c7c7248a (patch) | |
| tree | 8b6f841d443e2fd60200523b4fdbc94647d71521 | |
| parent | bc1e8f56ff1f20d060f735f47f58acad1303ed37 (diff) | |
Notes
| -rw-r--r-- | usr.bin/nl/nl.1 | 16 | ||||
| -rw-r--r-- | usr.bin/nl/nl.c | 3 |
2 files changed, 12 insertions, 7 deletions
diff --git a/usr.bin/nl/nl.1 b/usr.bin/nl/nl.1 index 554e18d241d0a..cb67c046a118c 100644 --- a/usr.bin/nl/nl.1 +++ b/usr.bin/nl/nl.1 @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 26, 2005 +.Dd May 4, 2014 .Dt NL 1 .Os .Sh NAME @@ -71,12 +71,16 @@ The .Nm utility reads lines from the named +.Ar file , +applies a configurable line numbering filter operation, +and writes the result to the standard output. +If .Ar file -or the standard input if the -.Ar file -argument is omitted, -applies a configurable line numbering filter operation and writes the result -to the standard output. +is a single dash +.Pq Sq Fl +or absent, +.Nm +reads from the standard input. .Pp The .Nm diff --git a/usr.bin/nl/nl.c b/usr.bin/nl/nl.c index 9c2ae64ac9136..1770b7808be81 100644 --- a/usr.bin/nl/nl.c +++ b/usr.bin/nl/nl.c @@ -242,7 +242,8 @@ main(int argc, char *argv[]) case 0: break; case 1: - if (freopen(argv[0], "r", stdin) == NULL) + if (strcmp(argv[0], "-") != 0 && + freopen(argv[0], "r", stdin) == NULL) err(EXIT_FAILURE, "%s", argv[0]); break; default: |
