all repos — fluxbox @ a1ff4f84e63a0038e373188144b8a36cfe2f3ccc

custom fork of the fluxbox windowmanager

limit looping
fluxgen fluxgen
commit

a1ff4f84e63a0038e373188144b8a36cfe2f3ccc

parent

2db11d210484ad754026e769c05ce85e10afbb7c

1 files changed, 5 insertions(+), 2 deletions(-)

jump to
M util/fluxbox-generate_menu.inutil/fluxbox-generate_menu.in

@@ -22,7 +22,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # 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:

@@ -220,8 +220,11 @@ clean_up() {

# Some magic to clean up empty menus rm -f ${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} + counter=`expr $counter - 1` grep -v '^$' ${MENUFILENAME}|sed -e "/^\[submenu].*/{ n N