aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2018-12-09 23:58:09 +0000
committerNIIBE Yutaka <[email protected]>2018-12-09 23:58:09 +0000
commit1d71dbb13709318567aba5b61928d8af37563097 (patch)
treef0dce88d08f0bd95f1eb26fd7da8aca59ad3d763
parentSilence cc warning about snprintf redefinition (diff)
downloadlibgpg-error-1d71dbb13709318567aba5b61928d8af37563097.tar.gz
libgpg-error-1d71dbb13709318567aba5b61928d8af37563097.zip
gpgrt-config: Portability fix for use of expr.
* src/gpgrt-config (sysroot): Care about possible interpretation of minus sign be considered an option to a program. (MAIN): Don't use 'match' of expr but use ':' instead. -- Reported-by: Roman Bogorodskiy <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
-rwxr-xr-xsrc/gpgrt-config6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gpgrt-config b/src/gpgrt-config
index 3a76869..646224f 100755
--- a/src/gpgrt-config
+++ b/src/gpgrt-config
@@ -404,8 +404,8 @@ sysroot () {
_result="$_result${_result:+ }$_opt"
shift
_result="$_result $PKG_CONFIG_SYSROOT_DIR$1"
- elif expr "$1" : "^$_opt" >/dev/null; then
- _result="$_result${_result:+ }$_opt$PKG_CONFIG_SYSROOT_DIR$(expr "$1" : "^$_opt\(.*\)")"
+ elif expr "x$1" : "^x$_opt" >/dev/null; then
+ _result="$_result${_result:+ }$_opt$PKG_CONFIG_SYSROOT_DIR$(expr "x$1" : "^x$_opt\(.*\)")"
else
_result="$_result${_result:+ }$1"
fi
@@ -575,7 +575,7 @@ done
if [ -z "$module_list" ]; then
module_list=$default_module
-elif expr match "$module_list" "=\|!=\|<\|>\|<=\|>=" >/dev/null; then
+elif expr "$module_list" : "=\|!=\|<\|>\|<=\|>=" >/dev/null; then
module_list="$default_module $module_list"
fi