Skip to contentSkip to conversation

tests/toolbox.inc.sh: update regex for getting endian

PATCH New [email protected] 1 participant 1 message Dec 2, 2022 Keys/keyrings

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/toolbox.inc.sh: update regex for getting endian

From: Changqing Li <[email protected]>

Update regex for get endian to following condition:
/proc/777/exe: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2

---
 tests/toolbox.inc.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/toolbox.inc.sh +2 -2
index 609a6c7..b1943a1 100644
@@ -13,10 +13,10 @@
 echo === $OUTPUTFILE ===
 
 endian=`file -L /proc/$$/exe`
-if expr "$endian" : '.* MSB \+\(pie executable\|executable\|shared object\).*' >&/dev/null
+if expr "$endian" : '.* MSB .*\(pie executable\|executable\|shared object\).*' >&/dev/null
 then
     endian=BE
-elif expr "$endian" : '.* LSB \+\(pie executable\|executable\|shared object\).*' >&/dev/null
+elif expr "$endian" : '.* LSB .*\(pie executable\|executable\|shared object\).*' >&/dev/null
 then
     endian=LE
 else
Signature · 1 line
2.37.1