# HG changeset patch # User Rob Landley # Date 1306039139 18000 # Node ID 5198cfb8e368c6ebcdf9e3db213c88b5713f84f4 # Parent 71acb8c4611a0ed1291e9f8ecd7383bcfb4bfe28 Cosmetic tweak to miniconfig script. diff -r 71acb8c4611a -r 5198cfb8e368 sources/toys/miniconfig.sh --- a/sources/toys/miniconfig.sh Sat May 21 23:37:31 2011 -0500 +++ b/sources/toys/miniconfig.sh Sat May 21 23:38:59 2011 -0500 @@ -76,10 +76,7 @@ I=1 while true do - if [ $I -gt $LENGTH ] - then - break - fi + [ $I -gt $LENGTH ] && break sed -n "$I,$(($I+${STRIDE:-1}-1))!p" mini.config > .config.test # Do a config with this file rm .config @@ -90,6 +87,9 @@ # Found unneeded line(s) mv .config.test mini.config LENGTH=$(($LENGTH-${STRIDE:-1})) + # Cosmetic: if stride tests off the end don't show total length less + # than number of entries found. + [ $I -gt $LENGTH ] && LENGTH=$(($I-1)) # Special case where we know the next line _is_ needed: stride 2 failed # but we discarded the first line [ -z "$STRIDE" ] && [ ${OLDSTRIDE:-1} -eq 2 ] && I=$(($I+1))