aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xz/patches/000-upstream-001-check_compress.patch
diff options
context:
space:
mode:
authorAlexandros C. Couloumbis <alex@ozo.com>2011-03-10 18:41:33 +0000
committerAlexandros C. Couloumbis <alex@ozo.com>2011-03-10 18:41:33 +0000
commit58a5102338f7fde82c0a025d99f044868c979d02 (patch)
tree6661a9d7d9e5f24a4a8c23eb41b73e20a4e579d0 /tools/xz/patches/000-upstream-001-check_compress.patch
parent29150bceb2ac9452934063d3a23678b114250f14 (diff)
downloadupstream-58a5102338f7fde82c0a025d99f044868c979d02.tar.gz
upstream-58a5102338f7fde82c0a025d99f044868c979d02.tar.bz2
upstream-58a5102338f7fde82c0a025d99f044868c979d02.zip
tools/xz: add some upstream patches
SVN-Revision: 26018
Diffstat (limited to 'tools/xz/patches/000-upstream-001-check_compress.patch')
-rw-r--r--tools/xz/patches/000-upstream-001-check_compress.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/xz/patches/000-upstream-001-check_compress.patch b/tools/xz/patches/000-upstream-001-check_compress.patch
new file mode 100644
index 0000000000..1b918a4f30
--- /dev/null
+++ b/tools/xz/patches/000-upstream-001-check_compress.patch
@@ -0,0 +1,32 @@
+From: Lasse Collin <lasse.collin@tukaani.org>
+Date: Fri, 4 Feb 2011 09:29:47 +0000 (+0200)
+Subject: xz: Check if the file already has custom suffix when compressing.
+X-Git-Url: http://repo.or.cz/w/xz.git/commitdiff_plain/8930c7ae3f82bdae15aa129f01de08be23d7e8d7
+
+xz: Check if the file already has custom suffix when compressing.
+
+Now "xz -S .test foo.test" refuses to compress the
+file because it already has the suffix .test. The man
+page had it documented this way already.
+---
+
+diff --git a/src/xz/suffix.c b/src/xz/suffix.c
+index ea86c1a..f795e2a 100644
+--- a/src/xz/suffix.c
++++ b/src/xz/suffix.c
+@@ -183,6 +183,15 @@ compressed_name(const char *src_name, const size_t src_len)
+ }
+ }
+
++ if (custom_suffix != NULL) {
++ if (test_suffix(custom_suffix, src_name, src_len) != 0) {
++ message_warning(_("%s: File already has `%s' "
++ "suffix, skipping"), src_name,
++ custom_suffix);
++ return NULL;
++ }
++ }
++
+ // TODO: Hmm, maybe it would be better to validate this in args.c,
+ // since the suffix handling when decoding is weird now.
+ if (opt_format == FORMAT_RAW && custom_suffix == NULL) {