includes.sh (259054) | includes.sh (273067) |
---|---|
1#!/bin/sh 2#- 3# Copyright (c) 2013 Devin Teske 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: --- 10 unchanged lines hidden (view full) --- 19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25# SUCH DAMAGE. 26# | 1#!/bin/sh 2#- 3# Copyright (c) 2013 Devin Teske 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: --- 10 unchanged lines hidden (view full) --- 19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25# SUCH DAMAGE. 26# |
27# $FreeBSD: head/usr.sbin/bsdconfig/includes/includes 259054 2013-12-07 00:31:01Z dteske $ | 27# $FreeBSD: head/usr.sbin/bsdconfig/includes/includes 273067 2014-10-14 03:11:46Z dteske $ |
28# 29############################################################ INCLUDES 30 31# Prevent common.subr from auto initializing debugging (this is not an inter- 32# active utility that requires debugging; also `-d' has been repurposed). 33# 34DEBUG_SELF_INITIALIZE=NO 35 --- 30 unchanged lines hidden (view full) --- 66 67 local pattern="${FUNC_PATTERN:-.*}" 68 output=$( awk \ 69 -v use_color=${USE_COLOR:-0} \ 70 -v re="$pattern" \ 71 -v show_desc=${SHOW_DESC:-0} ' 72 function asorti(src, dest) 73 { | 28# 29############################################################ INCLUDES 30 31# Prevent common.subr from auto initializing debugging (this is not an inter- 32# active utility that requires debugging; also `-d' has been repurposed). 33# 34DEBUG_SELF_INITIALIZE=NO 35 --- 30 unchanged lines hidden (view full) --- 66 67 local pattern="${FUNC_PATTERN:-.*}" 68 output=$( awk \ 69 -v use_color=${USE_COLOR:-0} \ 70 -v re="$pattern" \ 71 -v show_desc=${SHOW_DESC:-0} ' 72 function asorti(src, dest) 73 { |
74 k = nitems = 0; 75 |
|
74 # Copy src indices to dest and calculate array length | 76 # Copy src indices to dest and calculate array length |
75 nitems = 0; for (i in src) dest[++nitems] = i | 77 for (i in src) dest[++nitems] = i |
76 77 # Sort the array of indices (dest) using insertion sort method 78 for (i = 1; i <= nitems; k = i++) 79 { 80 idx = dest[i] 81 while ((k > 0) && (dest[k] > idx)) 82 { 83 dest[k+1] = dest[k] --- 120 unchanged lines hidden --- | 78 79 # Sort the array of indices (dest) using insertion sort method 80 for (i = 1; i <= nitems; k = i++) 81 { 82 idx = dest[i] 83 while ((k > 0) && (dest[k] > idx)) 84 { 85 dest[k+1] = dest[k] --- 120 unchanged lines hidden --- |