From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 00:30:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0733F846; Thu, 5 Mar 2015 00:30:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAF62B5A; Thu, 5 Mar 2015 00:29:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t250Tx0H081414; Thu, 5 Mar 2015 00:29:59 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t250TxUq081409; Thu, 5 Mar 2015 00:29:59 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201503050029.t250TxUq081409@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 5 Mar 2015 00:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r279609 - in stable/10/usr.sbin/bsdconfig: includes share share/packages X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 00:30:00 -0000 Author: dteske Date: Thu Mar 5 00:29:58 2015 New Revision: 279609 URL: https://svnweb.freebsd.org/changeset/base/279609 Log: MFC r273067: Fix awk(1) asorti() implementation to work when called in a loop. Modified: stable/10/usr.sbin/bsdconfig/includes/includes stable/10/usr.sbin/bsdconfig/share/device.subr stable/10/usr.sbin/bsdconfig/share/packages/index.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/includes/includes ============================================================================== --- stable/10/usr.sbin/bsdconfig/includes/includes Thu Mar 5 00:18:32 2015 (r279608) +++ stable/10/usr.sbin/bsdconfig/includes/includes Thu Mar 5 00:29:58 2015 (r279609) @@ -71,8 +71,10 @@ show_include() -v show_desc=${SHOW_DESC:-0} ' function asorti(src, dest) { + k = nitems = 0; + # Copy src indices to dest and calculate array length - nitems = 0; for (i in src) dest[++nitems] = i + for (i in src) dest[++nitems] = i # Sort the array of indices (dest) using insertion sort method for (i = 1; i <= nitems; k = i++) Modified: stable/10/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/device.subr Thu Mar 5 00:18:32 2015 (r279608) +++ stable/10/usr.sbin/bsdconfig/share/device.subr Thu Mar 5 00:29:58 2015 (r279609) @@ -1118,6 +1118,7 @@ f_device_sort_by_awk=' # -v prop="property" function asorti(src, dest) { + k = nitems = 0 for (i in src) dest[++nitems] = i for (i = 1; i <= nitems; k = i++) { idx = dest[i] Modified: stable/10/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/packages/index.subr Thu Mar 5 00:18:32 2015 (r279608) +++ stable/10/usr.sbin/bsdconfig/share/packages/index.subr Thu Mar 5 00:29:58 2015 (r279609) @@ -243,8 +243,10 @@ f_index_read() eval "$( debug= f_getvar "$var_to_get" | awk -F'|' ' function asorti(src, dest) { + k = nitems = 0 + # Copy src indices to dest and calculate array length - nitems = 0; for (i in src) dest[++nitems] = i + for (i in src) dest[++nitems] = i # Sort the array of indices (dest) using insertion sort method for (i = 1; i <= nitems; k = i++)