summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDror Levin <spatz@gentoo.org>2010-09-04 13:23:51 +0000
committerDror Levin <spatz@gentoo.org>2010-09-04 13:23:51 +0000
commit4f0a65fef2bb282b64b22890aafe364630895dc8 (patch)
tree2645ea0d50cefb9d48cbed25d0d1387c2dd672cc /app-arch/pigz/files
parentalpha stable (diff)
downloadgentoo-2-4f0a65fef2bb282b64b22890aafe364630895dc8.tar.gz
gentoo-2-4f0a65fef2bb282b64b22890aafe364630895dc8.tar.bz2
gentoo-2-4f0a65fef2bb282b64b22890aafe364630895dc8.zip
Add patch to support double dash command-line option (--), bug 335852.
(Portage version: 2.2_rc74/cvs/Linux x86_64)
Diffstat (limited to 'app-arch/pigz/files')
-rw-r--r--app-arch/pigz/files/pigz-2.1.6-doubledash.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/app-arch/pigz/files/pigz-2.1.6-doubledash.patch b/app-arch/pigz/files/pigz-2.1.6-doubledash.patch
new file mode 100644
index 000000000000..d528a7956b76
--- /dev/null
+++ b/app-arch/pigz/files/pigz-2.1.6-doubledash.patch
@@ -0,0 +1,45 @@
+diff --git a/pigz.c b/pigz.c
+index 97e6faa..29d88c3 100644
+--- a/pigz.c
++++ b/pigz.c
+@@ -2940,6 +2940,9 @@ local int option(char *arg)
+ arg = longopts[j][1];
+ break;
+ }
++ /* double dash to terminate option processing */
++ if (*(arg-1) == '-')
++ return 2;
+ if (j < 0)
+ bail("invalid option: ", arg - 2);
+ }
+@@ -3061,6 +3064,7 @@ int main(int argc, char **argv)
+ int n; /* general index */
+ unsigned long done; /* number of named files processed */
+ char *opts, *p; /* environment default options, marker */
++ int doubledash; /* -- to terminate option checking */
+
+ /* prepare for interrupts and logging */
+ signal(SIGINT, cut_short);
+@@ -3106,15 +3110,20 @@ int main(int argc, char **argv)
+
+ /* process command-line arguments */
+ done = 0;
+- for (n = 1; n < argc; n++)
+- if (option(argv[n])) { /* true if file name, process it */
++ doubledash = 0;
++ for (n = 1; n < argc; n++) {
++ int optionreturn = doubledash ? 1 : option(argv[n]);
++ if (optionreturn == 1) { /* true if file name, process it */
+ if (done == 1 && pipeout && !decode && !list && form > 1) {
+ fprintf(stderr, "warning: output is concatenated zip files ");
+ fprintf(stderr, "-- pigz will not be able to extract\n");
+ }
+ process(strcmp(argv[n], "-") ? argv[n] : NULL);
+ done++;
++ } else if (optionreturn == 2) {
++ doubledash++;
+ }
++ }
+ option(NULL);
+
+ /* list stdin or compress stdin to stdout if no file names provided */