diff options
author | fluxgen <fluxgen> | 2004-01-12 11:14:55 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-01-12 11:14:55 (GMT) |
commit | a1ff4f84e63a0038e373188144b8a36cfe2f3ccc (patch) | |
tree | 68fad467fb613ae6c41953dc190824bfba54463b /util/fluxbox-generate_menu.in | |
parent | 2db11d210484ad754026e769c05ce85e10afbb7c (diff) | |
download | fluxbox-a1ff4f84e63a0038e373188144b8a36cfe2f3ccc.zip fluxbox-a1ff4f84e63a0038e373188144b8a36cfe2f3ccc.tar.bz2 |
limit looping
Diffstat (limited to 'util/fluxbox-generate_menu.in')
-rwxr-xr-x | util/fluxbox-generate_menu.in | 7 |
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 |
221 | rm -f ${MENUFILENAME}.tmp | 221 | rm -f ${MENUFILENAME}.tmp |
222 | touch ${MENUFILENAME}.tmp | 222 | touch ${MENUFILENAME}.tmp |
223 | until diff -u ${MENUFILENAME} ${MENUFILENAME}.tmp > /dev/null 2>&1; do | 223 | local counter=10 # prevent looping in odd circumstances |
224 | until [ $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].*/{ |
226 | n | 229 | n |
227 | N | 230 | N |