Fixed some item name escaping when containin < or > characters

This commit is contained in:
Louwrentius 2010-05-14 15:54:28 +00:00
parent 7c2d336dba
commit 9feea3fb59

7
ppss
View File

@ -1345,6 +1345,8 @@ escape_item () {
sed s/\\|/\\\\\\\\\\\\\\|/g | \ sed s/\\|/\\\\\\\\\\\\\\|/g | \
sed s/\&/\\\\\\\\\\\\\\&/g | \ sed s/\&/\\\\\\\\\\\\\\&/g | \
sed s/\;/\\\\\\\\\\\\\\;/g | \ sed s/\;/\\\\\\\\\\\\\\;/g | \
sed s/\>/\\\\\\\\\\>/g | \
sed s/\</\\\\\\\\\\</g | \
sed s/\(/\\\\\\\\\\(/g | \ sed s/\(/\\\\\\\\\\(/g | \
sed s/\)/\\\\\\\\\\)/g ` sed s/\)/\\\\\\\\\\)/g `
} }
@ -1628,6 +1630,7 @@ get_item () {
fi fi
ITEM="${ARRAY[$ARRAY_POINTER]}" ITEM="${ARRAY[$ARRAY_POINTER]}"
if [ -z "$ITEM" ] if [ -z "$ITEM" ]
then then
((ARRAY_POINTER++)) ((ARRAY_POINTER++))
@ -1707,7 +1710,6 @@ elapsed () {
} }
commando () { commando () {
log DEBUG "-------------------------------------" log DEBUG "-------------------------------------"
if [ "$DAEMON" == "1" ] if [ "$DAEMON" == "1" ]
then then
@ -1736,6 +1738,7 @@ commando () {
# #
ITEM="$1" ITEM="$1"
if [ "$RECURSION" == "1" ] if [ "$RECURSION" == "1" ]
then then
escape_item "$ITEM" escape_item "$ITEM"
@ -1754,6 +1757,7 @@ commando () {
# structure. If recursion is not used, this is not necessary. # structure. If recursion is not used, this is not necessary.
# #
if [ "$ERR_STATE" == "0" ] if [ "$ERR_STATE" == "0" ]
then then
VIRTUAL="0" VIRTUAL="0"
@ -1814,6 +1818,7 @@ commando () {
fi fi
fi fi
# #
# Create the log file containing the output of the command. # Create the log file containing the output of the command.
# #