lobase

Linux port of OpenBSDs userland.
Log | Files | Refs | README

commit b3fb7ce077d38f802225feeba316a4528bc2e646
parent 47b16dc709eb183d85439e732e381bcdfea3daa2
Author: Duncaen <mail@duncano.de>
Date:   Fri, 19 May 2017 18:21:06 +0200

usr.bin/sort: update to OPENBSD_6_1

Diffstat:
usr.bin/sort/coll.c | 10+++++-----
usr.bin/sort/file.c | 4++--
usr.bin/sort/sort.1 | 14+++++++++-----
usr.bin/sort/sort.c | 9++++++---
usr.bin/sort/test.c | 1-
5 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/usr.bin/sort/coll.c b/usr.bin/sort/coll.c @@ -782,7 +782,7 @@ cmpsuffix(unsigned char si1, unsigned char si2) */ static int numcoll_impl(struct key_value *kv1, struct key_value *kv2, - size_t offset __UNUSED, bool use_suffix) + size_t offset __unused, bool use_suffix) { struct bwstring *s1, *s2; wchar_t sfrac1[MAX_NUM_SIZE + 1], sfrac2[MAX_NUM_SIZE + 1]; @@ -955,7 +955,7 @@ hnumcoll(struct key_value *kv1, struct key_value *kv2, size_t offset) */ static int randomcoll(struct key_value *kv1, struct key_value *kv2, - size_t offset __UNUSED) + size_t offset __unused) { struct bwstring *s1, *s2; MD5_CTX ctx1, ctx2; @@ -1008,7 +1008,7 @@ randomcoll(struct key_value *kv1, struct key_value *kv2, */ static int versioncoll(struct key_value *kv1, struct key_value *kv2, - size_t offset __UNUSED) + size_t offset __unused) { struct bwstring *s1, *s2; @@ -1081,7 +1081,7 @@ cmp_nans(double d1, double d2) */ static int gnumcoll(struct key_value *kv1, struct key_value *kv2, - size_t offset __UNUSED) + size_t offset __unused) { double d1, d2; int err1, err2; @@ -1237,7 +1237,7 @@ gnumcoll(struct key_value *kv1, struct key_value *kv2, * Implements month sort (-M). */ static int -monthcoll(struct key_value *kv1, struct key_value *kv2, size_t offset __UNUSED) +monthcoll(struct key_value *kv1, struct key_value *kv2, size_t offset __unused) { int val1, val2; bool key1_read, key2_read; diff --git a/usr.bin/sort/file.c b/usr.bin/sort/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.20 2015/04/03 10:37:24 tobias Exp $ */ +/* $OpenBSD: file.c,v 1.21 2016/10/17 02:58:29 lteo Exp $ */ /*- * Copyright (C) 2009 Gabor Kovesdan <gabor@FreeBSD.org> @@ -50,7 +50,7 @@ unsigned long long available_free_memory = 1000000; bool use_mmap; -const char *tmpdir = "/var/tmp"; +const char *tmpdir = "/tmp"; const char *compress_program; size_t max_open_files = 16; diff --git a/usr.bin/sort/sort.1 b/usr.bin/sort/sort.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sort.1,v 1.54 2015/04/05 14:20:22 millert Exp $ +.\" $OpenBSD: sort.1,v 1.56 2016/10/17 02:58:29 lteo Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -32,7 +32,7 @@ .\" .\" @(#)sort.1 8.1 (Berkeley) 6/6/93 .\" -.Dd $Mdocdate: April 5 2015 $ +.Dd $Mdocdate: October 17 2016 $ .Dt SORT 1 .Os .Sh NAME @@ -52,7 +52,11 @@ The .Nm utility sorts text and binary files by lines. A line is a record separated from the subsequent record by a -newline (default) or NUL \'\\0\' character (-z option). +newline (default) or NUL \'\\0\' character +.Po +.Fl z +option +.Pc . A record can contain any printable or unprintable characters. Comparisons are based on one or more sort keys extracted from each line of input, and are performed lexicographically, @@ -110,7 +114,7 @@ Store temporary files in the directory The default path is the value of the environment variable .Ev TMPDIR or -.Pa /var/tmp +.Pa /tmp if .Ev TMPDIR is not defined. @@ -541,7 +545,7 @@ option. .El .Sh FILES .Bl -tag -width Pa -compact -.It Pa /var/tmp/.bsdsort.PID.* +.It Pa /tmp/.bsdsort.PID.* Temporary files. .El .Sh EXIT STATUS diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sort.c,v 1.86 2016/07/14 08:31:18 semarie Exp $ */ +/* $OpenBSD: sort.c,v 1.87 2017/01/04 15:30:58 millert Exp $ */ /*- * Copyright (C) 2009 Gabor Kovesdan <gabor@FreeBSD.org> @@ -402,7 +402,7 @@ invalid: * Signal handler that clears the temporary files. */ static void -sig_handler(int sig __UNUSED) +sig_handler(int sig __unused) { clear_tmp_files(); _exit(2); @@ -1231,7 +1231,10 @@ main(int argc, char *argv[]) struct file_list fl; file_list_init(&fl, false); - file_list_populate(&fl, argc, argv, true); + if (argc < 1) + file_list_add(&fl, "-", true); + else + file_list_populate(&fl, argc, argv, true); merge_files(&fl, outfile); file_list_clean(&fl); } diff --git a/usr.bin/sort/test.c b/usr.bin/sort/test.c @@ -1 +0,0 @@ -#include <md5.h>