1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

- Fix expr usage for 4.x since expr on 4.x

is not POSIX compliant. [1]

Submitted by:	girgen [1]
This commit is contained in:
Michael Johnson 2004-12-29 03:28:51 +00:00
parent 5cffd563b1
commit 6d3f2a711b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=125415
4 changed files with 12 additions and 12 deletions

View File

@ -5,14 +5,14 @@
#???: needs check if othersopt begin with -* ?
-if [ `expr "${_optLast}" : '.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
+if [ `expr -- "${_optLast}" : '.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
+if [ `expr X"${_optLast}" : 'X.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
# Last argument seems to be a local file/directory
# Check, if it is absolutely specified (ie. /home/foo/file vs. ./file)
# If it is just "relatively" (./file) specified, make it absolutely
- [ `expr "${_optLast}" : '/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
-elif [ `expr "${_optLast}" : '.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
+ [ `expr -- "${_optLast}" : '/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
+elif [ `expr -- "${_optLast}" : '.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
+ [ `expr X"${_optLast}" : 'X/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
+elif [ `expr X"${_optLast}" : 'X.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
_NEW_WINDOW=1
fi
################################################################ Parse Arguments

View File

@ -5,14 +5,14 @@
#???: needs check if othersopt begin with -* ?
-if [ `expr "${_optLast}" : '.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
+if [ `expr -- "${_optLast}" : '.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
+if [ `expr X"${_optLast}" : 'X.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
# Last argument seems to be a local file/directory
# Check, if it is absolutely specified (ie. /home/foo/file vs. ./file)
# If it is just "relatively" (./file) specified, make it absolutely
- [ `expr "${_optLast}" : '/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
-elif [ `expr "${_optLast}" : '.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
+ [ `expr -- "${_optLast}" : '/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
+elif [ `expr -- "${_optLast}" : '.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
+ [ `expr X"${_optLast}" : 'X/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
+elif [ `expr X"${_optLast}" : 'X.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
_NEW_WINDOW=1
fi
################################################################ Parse Arguments

View File

@ -5,14 +5,14 @@
#???: needs check if othersopt begin with -* ?
-if [ `expr "${_optLast}" : '.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
+if [ `expr -- "${_optLast}" : '.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
+if [ `expr X"${_optLast}" : 'X.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
# Last argument seems to be a local file/directory
# Check, if it is absolutely specified (ie. /home/foo/file vs. ./file)
# If it is just "relatively" (./file) specified, make it absolutely
- [ `expr "${_optLast}" : '/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
-elif [ `expr "${_optLast}" : '.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
+ [ `expr -- "${_optLast}" : '/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
+elif [ `expr -- "${_optLast}" : '.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
+ [ `expr X"${_optLast}" : 'X/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
+elif [ `expr X"${_optLast}" : 'X.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
_NEW_WINDOW=1
fi
################################################################ Parse Arguments

View File

@ -5,14 +5,14 @@
#???: needs check if othersopt begin with -* ?
-if [ `expr "${_optLast}" : '.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
+if [ `expr -- "${_optLast}" : '.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
+if [ `expr X"${_optLast}" : 'X.*:/.*'` -eq 0 -a \( -f "${_optLast}" -o -d "${_optLast}" \) ]; then
# Last argument seems to be a local file/directory
# Check, if it is absolutely specified (ie. /home/foo/file vs. ./file)
# If it is just "relatively" (./file) specified, make it absolutely
- [ `expr "${_optLast}" : '/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
-elif [ `expr "${_optLast}" : '.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
+ [ `expr -- "${_optLast}" : '/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
+elif [ `expr -- "${_optLast}" : '.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
+ [ `expr X"${_optLast}" : 'X/.*'` -eq 0 ] && _optLast="file://`pwd`/${_optLast}"
+elif [ `expr X"${_optLast}" : 'X.*:/.*'` -gt 0 -o -n "${_optOthers}" ]; then #???? like before...
_NEW_WINDOW=1
fi
################################################################ Parse Arguments