cnd / rpms / gzip

Forked from rpms/gzip 3 years ago
Clone

Blame SOURCES/gzexe.patch

e0b487
From 21cd963565a43dabd59516bd4cca5c76a614f255 Mon Sep 17 00:00:00 2001
e0b487
From: Jakub Martisko <jamartis@redhat.com>
e0b487
Date: Tue, 26 Mar 2019 12:29:30 +0100
e0b487
Subject: [PATCH] Fix: the value of the skip variable in the gzexe
e0b487
e0b487
---
e0b487
 gzexe.in          |  4 ++--
e0b487
 tests/Makefile.am |  1 +
e0b487
 tests/gzexe       | 20 ++++++++++++++++++++
e0b487
 3 files changed, 23 insertions(+), 2 deletions(-)
e0b487
 create mode 100755 tests/gzexe
e0b487
e0b487
diff --git a/gzexe.in b/gzexe.in
e0b487
index 6c61183..cffa84e 100644
e0b487
--- a/gzexe.in
e0b487
+++ b/gzexe.in
e0b487
@@ -145,7 +145,7 @@ for i do
e0b487
   if test $decomp -eq 0; then
e0b487
     (cat <<'EOF' &&
e0b487
 #!/bin/sh
e0b487
-skip=44
e0b487
+skip=49
e0b487
 
e0b487
 tab='	'
e0b487
 nl='
e0b487
@@ -201,7 +201,7 @@ EOF
e0b487
 
e0b487
   else
e0b487
     # decompression
e0b487
-    skip=44
e0b487
+    skip=49
e0b487
     skip_line=`sed -e 1d -e 2q "$file"`
e0b487
     case $skip_line in
e0b487
     skip=[0-9] | skip=[0-9][0-9] | skip=[0-9][0-9][0-9])
e0b487
diff --git a/tests/Makefile.am b/tests/Makefile.am
e0b487
index ebdce5b..4dfbccf 100644
e0b487
--- a/tests/Makefile.am
e0b487
+++ b/tests/Makefile.am
e0b487
@@ -15,6 +15,7 @@
e0b487
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
e0b487
 
e0b487
 TESTS =					\
e0b487
+	gzexe				\
e0b487
   gzip-env				\
e0b487
   helin-segv				\
e0b487
   help-version				\
e0b487
diff --git a/tests/gzexe b/tests/gzexe
e0b487
new file mode 100755
e0b487
index 0000000..45f71c7
e0b487
--- /dev/null
e0b487
+++ b/tests/gzexe
e0b487
@@ -0,0 +1,20 @@
e0b487
+#!/bin/sh
e0b487
+#Try running simple shell script compressed by gzexe
e0b487
+
e0b487
+. "${srcdir=.}/init.sh"; path_prepend_ ..
e0b487
+
e0b487
+cat <<EOF > foo || framework_failure_
e0b487
+#!/bin/sh
e0b487
+echo "Hello World!"
e0b487
+EOF
e0b487
+
e0b487
+echo "Hello World!" > exp || framework_failure_
e0b487
+
e0b487
+fail=0
e0b487
+gzexe foo || fail=1
e0b487
+/bin/sh foo > out 2> err || fail=1
e0b487
+
e0b487
+compare exp out || fail=1
e0b487
+test -s err && fail=1
e0b487
+
e0b487
+Exit $fail
e0b487
-- 
e0b487
2.21.0
e0b487