summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-01-12 11:14:55 (GMT)
committerfluxgen <fluxgen>2004-01-12 11:14:55 (GMT)
commita1ff4f84e63a0038e373188144b8a36cfe2f3ccc (patch)
tree68fad467fb613ae6c41953dc190824bfba54463b
parent2db11d210484ad754026e769c05ce85e10afbb7c (diff)
downloadfluxbox_lack-a1ff4f84e63a0038e373188144b8a36cfe2f3ccc.zip
fluxbox_lack-a1ff4f84e63a0038e373188144b8a36cfe2f3ccc.tar.bz2
limit looping
-rwxr-xr-xutil/fluxbox-generate_menu.in7
1 files changed, 5 insertions, 2 deletions
diff --git a/util/fluxbox-generate_menu.in b/util/fluxbox-generate_menu.in
index 199bc30..aba7b04 100755
--- a/util/fluxbox-generate_menu.in
+++ b/util/fluxbox-generate_menu.in
@@ -22,7 +22,7 @@
22# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23# DEALINGS IN THE SOFTWARE. 23# DEALINGS IN THE SOFTWARE.
24# 24#
25# $Id: fluxbox-generate_menu.in,v 1.10 2004/01/03 00:43:43 fluxgen Exp $ 25# $Id: fluxbox-generate_menu.in,v 1.11 2004/01/12 11:14:55 fluxgen Exp $
26 26
27# 27#
28# Portability notes: 28# Portability notes:
@@ -220,8 +220,11 @@ clean_up() {
220# Some magic to clean up empty menus 220# Some magic to clean up empty menus
221rm -f ${MENUFILENAME}.tmp 221rm -f ${MENUFILENAME}.tmp
222touch ${MENUFILENAME}.tmp 222touch ${MENUFILENAME}.tmp
223until diff -u ${MENUFILENAME} ${MENUFILENAME}.tmp > /dev/null 2>&1; do 223local counter=10 # prevent looping in odd circumstances
224until [ $counter -lt 1 ] || \
225 diff -u ${MENUFILENAME} ${MENUFILENAME}.tmp 2>&1 > /dev/null; do
224 [ -s ${MENUFILENAME}.tmp ] && mv ${MENUFILENAME}.tmp ${MENUFILENAME} 226 [ -s ${MENUFILENAME}.tmp ] && mv ${MENUFILENAME}.tmp ${MENUFILENAME}
227 counter=`expr $counter - 1`
225 grep -v '^$' ${MENUFILENAME}|sed -e "/^\[submenu].*/{ 228 grep -v '^$' ${MENUFILENAME}|sed -e "/^\[submenu].*/{
226n 229n
227N 230N