From 1d71dbb13709318567aba5b61928d8af37563097 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Mon, 10 Dec 2018 08:58:09 +0900 Subject: 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 Signed-off-by: NIIBE Yutaka --- src/gpgrt-config | 6 +++--- 1 file 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 -- cgit v1.2.3