Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Oct 2015 10:57:16 +0000 (UTC)
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r289751 - head/usr.bin/sort
Message-ID:  <201510221057.t9MAvG6A052974@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gabor
Date: Thu Oct 22 10:57:15 2015
New Revision: 289751
URL: https://svnweb.freebsd.org/changeset/base/289751

Log:
  -C and -c allow at most one input file. Ensure this is the case when the
  input files are specified through --files0-from.
  
  Submitted by:	tim@OpenBSD
  Obtained from:	OpenBSD
  MFC after:	1 week

Modified:
  head/usr.bin/sort/sort.c

Modified: head/usr.bin/sort/sort.c
==============================================================================
--- head/usr.bin/sort/sort.c	Thu Oct 22 09:55:40 2015	(r289750)
+++ head/usr.bin/sort/sort.c	Thu Oct 22 10:57:15 2015	(r289751)
@@ -1168,6 +1168,11 @@ main(int argc, char **argv)
 	argc -= optind;
 	argv += optind;
 
+	if (argv_from_file0) {
+		argc = argc_from_file0;
+		argv = argv_from_file0;
+	}
+
 #ifndef WITHOUT_NLS
 	catalog = catopen("sort", NL_CAT_LOCALE);
 #endif
@@ -1205,11 +1210,6 @@ main(int argc, char **argv)
 		ks->sm.func = get_sort_func(&(ks->sm));
 	}
 
-	if (argv_from_file0) {
-		argc = argc_from_file0;
-		argv = argv_from_file0;
-	}
-
 	if (debug_sort) {
 		printf("Memory to be used for sorting: %llu\n",available_free_memory);
 #if defined(SORT_THREADS)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510221057.t9MAvG6A052974>