]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sort(1): Fix -m when only implicit stdin is used for input
authorKyle Evans <kevans@FreeBSD.org>
Wed, 20 Jun 2018 03:31:19 +0000 (03:31 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Wed, 20 Jun 2018 03:31:19 +0000 (03:31 +0000)
commit7137597e15bdd19c4aa33a0848595bec51b7a1da
tree26c1a689c9babbbf1ce5914c9c4f2aafe5521261
parent36180cd53d0e4d6bd4c5fb27c2f9ba80dbefa62c
sort(1): Fix -m when only implicit stdin is used for input

Observe:

printf "a\nb\nc\n" > /tmp/foo
# Next command results in no output
cat /tmp/foo | sort -m
# Next command results in proper output
cat /tmp/foo | sort -m -
# Also works:
sort -m /tmp/foo

Some const'ification was done to simplify the actual solution of adding "-"
explicitly to the file list if we didn't have any file arguments left over.

PR: 190099
MFC after: 1 week
usr.bin/sort/file.c
usr.bin/sort/file.h
usr.bin/sort/sort.c