limit looping
This commit is contained in:
parent
2db11d2104
commit
a1ff4f84e6
1 changed files with 5 additions and 2 deletions
|
@ -22,7 +22,7 @@
|
||||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
# DEALINGS IN THE SOFTWARE.
|
# DEALINGS IN THE SOFTWARE.
|
||||||
#
|
#
|
||||||
# $Id: fluxbox-generate_menu.in,v 1.10 2004/01/03 00:43:43 fluxgen Exp $
|
# $Id: fluxbox-generate_menu.in,v 1.11 2004/01/12 11:14:55 fluxgen Exp $
|
||||||
|
|
||||||
#
|
#
|
||||||
# Portability notes:
|
# Portability notes:
|
||||||
|
@ -220,8 +220,11 @@ clean_up() {
|
||||||
# Some magic to clean up empty menus
|
# Some magic to clean up empty menus
|
||||||
rm -f ${MENUFILENAME}.tmp
|
rm -f ${MENUFILENAME}.tmp
|
||||||
touch ${MENUFILENAME}.tmp
|
touch ${MENUFILENAME}.tmp
|
||||||
until diff -u ${MENUFILENAME} ${MENUFILENAME}.tmp > /dev/null 2>&1; do
|
local counter=10 # prevent looping in odd circumstances
|
||||||
|
until [ $counter -lt 1 ] || \
|
||||||
|
diff -u ${MENUFILENAME} ${MENUFILENAME}.tmp 2>&1 > /dev/null; do
|
||||||
[ -s ${MENUFILENAME}.tmp ] && mv ${MENUFILENAME}.tmp ${MENUFILENAME}
|
[ -s ${MENUFILENAME}.tmp ] && mv ${MENUFILENAME}.tmp ${MENUFILENAME}
|
||||||
|
counter=`expr $counter - 1`
|
||||||
grep -v '^$' ${MENUFILENAME}|sed -e "/^\[submenu].*/{
|
grep -v '^$' ${MENUFILENAME}|sed -e "/^\[submenu].*/{
|
||||||
n
|
n
|
||||||
N
|
N
|
||||||
|
|
Loading…
Reference in a new issue