fbgm used non-portable grep - option (-m) which is now replaced by

grep | head -n 1
This commit is contained in:
mathias 2005-06-18 17:21:13 +00:00
parent 019da77c56
commit 6c284b9c7c
2 changed files with 9 additions and 6 deletions

View file

@ -1,6 +1,8 @@
(Format: Year/Month/Day)
Changes for 0.9.14:
*05/06/18:
* Fixes #1206821, unportable usage of grep in fbgm (thanx Dung)
util/fluxbox-generate_menu.in
* Fixes #1116965, shadwd windows on restart (Mathias)
Window.cc
* little Fix for font effects (Mathias)

View file

@ -38,6 +38,7 @@
# - don't use id -u or $UID, use whoami
# - getopts won't work on all platforms, but the config-file can
# compensate for that.
# - OpenBSD and Solaris grep do not have the -m option
# - various software like grep/sed/perl may be not present or not
# the version you have. for example grep '\W' only works on gnu-grep.
# Keep this in mind, use bare basic defaults.
@ -271,7 +272,7 @@ doSearch(){
# $dnlamVERBOSE "# Searching for icon $temp_icon for $execname" >> $ICONMAPPING
# check in $ICONMAPPING before searching directories
entry_icon=`grep -m 1 "^\"${execname}\"" $ICONMAPPING | grep -o '<.*>'`
entry_icon=`grep "^\"${execname}\"" $ICONMAPPING | head -n 1 | grep -o '<.*>'`
if [ -n "$entry_icon" ]; then
entry_icon=`replaceWithinString "$entry_icon" "<"`
entry_icon=`replaceWithinString "$entry_icon" ">"`
@ -365,16 +366,16 @@ createIconMapping(){
# >> $ICONMAPPING
find "$DIR" -type f -name "*.desktop" | while read DESKTOP_FILE; do
# echo $DESKTOP_FILE;
#entry_name=`grep -m 1 '^[ ]*Name=' $DESKTOP_FILE`
#entry_name=`grep '^[ ]*Name=' $DESKTOP_FILE | head -n 1`
#entry_name=${entry_name##*=}
entry_exec=`grep -m 1 '^[ ]*Exec=' "$DESKTOP_FILE"`
entry_exec=`grep '^[ ]*Exec=' "$DESKTOP_FILE" | head -n 1`
entry_exec=${entry_exec##*=}
entry_exec=`replaceWithinString "$entry_exec" "\""`
if [ -z "$entry_exec" ]; then
entry_exec=${DESKTOP_FILE%%.desktop*}
fi
entry_icon=`grep -m 1 '^[ ]*Icon=' "$DESKTOP_FILE"`
entry_icon=`grep '^[ ]*Icon=' "$DESKTOP_FILE" | head -n 1`
entry_icon=${entry_icon##*=}
# $dnlamVERBOSE echo "--- $entry_exec $entry_icon" >&2
@ -407,11 +408,11 @@ lookupIcon() {
execname=`removePath "$execname"`
#echo "grepping ${execname}"
iconString=`grep -m 1 "^\"${execname}\"" $ICONMAPPING | grep -o '<.*>'`
iconString=`grep "^\"${execname}\"" $ICONMAPPING | head -n 1 | grep -o '<.*>'`
# $dnlamVERBOSE "lookupIcon $execname, $iconString" >&2
if [ -z "$iconString" ] ; then
iconString=`grep -m 1 "^\"${execname%% *}" $ICONMAPPING | grep -o '<.*>'`
iconString=`grep "^\"${execname%% *}" $ICONMAPPING | head -n 1 | grep -o '<.*>'`
fi
if [ -z "$iconString" ] && [ -z "$PARSING_DESKTOP" ] ; then