]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r335404: sort(1): Fix -m when only implicit stdin is used for input
authorkevans <kevans@FreeBSD.org>
Wed, 27 Jun 2018 21:11:28 +0000 (21:11 +0000)
committerkevans <kevans@FreeBSD.org>
Wed, 27 Jun 2018 21:11:28 +0000 (21:11 +0000)
commit49a1beba86c5a5982634c4f5a2a010783bc23a80
treeeda0e21015d4b8be2762c324377f29511dadf270
parente1f4b1bddd0958c65f79053016adb4e5def55c98
MFC r335404: 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
usr.bin/sort/file.c
usr.bin/sort/file.h
usr.bin/sort/sort.c