From 1762ce4e0b7877a9a880bca591b7bf14baba2844 Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Fri, 27 May 2016 16:12:33 +0200 Subject: [PATCH] tcsh-6.19.00-029-do-not-print-jobs-to-stderr.patch added 'jobs' builtin should print its output to stdout now: Related: #1338987 --- ...9.00-029-do-not-print-jobs-to-stderr.patch | 107 ++++++++++++++++++ tcsh.spec | 2 + 2 files changed, 109 insertions(+) create mode 100644 tcsh-6.19.00-029-do-not-print-jobs-to-stderr.patch diff --git a/tcsh-6.19.00-029-do-not-print-jobs-to-stderr.patch b/tcsh-6.19.00-029-do-not-print-jobs-to-stderr.patch new file mode 100644 index 0000000..a1f5468 --- /dev/null +++ b/tcsh-6.19.00-029-do-not-print-jobs-to-stderr.patch @@ -0,0 +1,107 @@ +From 17d484bfacf46fe1a36a8e4eafa590ad0a13615d Mon Sep 17 00:00:00 2001 +From: christos +Date: Tue, 24 May 2016 15:11:30 +0000 +Subject: [PATCH 1/2] preserve previous value of haderr. + +--- + sh.proc.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/sh.proc.c b/sh.proc.c +index e48a3b4..8472ef5 100644 +--- a/sh.proc.c ++++ b/sh.proc.c +@@ -993,6 +993,7 @@ pprint(struct process *pp, int flag) + struct process *tp; + int jobflags, pstatus, pcond; + const char *format; ++ int ohaderr; + + #ifdef BACKPIPE + struct process *pipehead = NULL, *pipetail = NULL, *pmarker = NULL; +@@ -1008,6 +1009,7 @@ pprint(struct process *pp, int flag) + tp = pp; + status = reason = -1; + jobflags = 0; ++ ohaderr = haderr; + haderr = 1; /* Print status to stderr */ + do { + #ifdef BACKPIPE +@@ -1217,7 +1219,7 @@ prcomd: + xprintf(" "); + ptprint(tp); + } +- haderr = 0; ++ haderr = ohaderr; + return (jobflags); + } + +-- +2.5.5 + + +From 50029cb5d4fe43059eacda5a6e5a25db2e94975e Mon Sep 17 00:00:00 2001 +From: christos +Date: Tue, 24 May 2016 17:41:12 +0000 +Subject: [PATCH 2/2] don't print jobs to stderr + (paulo.cesar.pereira.de.andrade) + +--- + sh.proc.c | 5 +++-- + sh.proc.h | 17 +++++++++-------- + 2 files changed, 12 insertions(+), 10 deletions(-) + +diff --git a/sh.proc.c b/sh.proc.c +index 8472ef5..49b199f 100644 +--- a/sh.proc.c ++++ b/sh.proc.c +@@ -1010,7 +1010,8 @@ pprint(struct process *pp, int flag) + status = reason = -1; + jobflags = 0; + ohaderr = haderr; +- haderr = 1; /* Print status to stderr */ ++ /* Print status to stderr, except for jobs built-in */ ++ haderr = !(flag & JOBLIST); + do { + #ifdef BACKPIPE + /* +@@ -1318,7 +1319,7 @@ void + dojobs(Char **v, struct command *c) + { + struct process *pp; +- int flag = NUMBER | NAME | REASON; ++ int flag = NUMBER | NAME | REASON | JOBLIST; + int i; + + USE(c); +diff --git a/sh.proc.h b/sh.proc.h +index 859e55a..919c7c3 100644 +--- a/sh.proc.h ++++ b/sh.proc.h +@@ -106,14 +106,15 @@ struct process { + #define PBRACE (1<<18) /* Process is {} evaluation */ + + /* defines for arguments to pprint */ +-#define NUMBER 01 +-#define NAME 02 +-#define REASON 04 +-#define AMPERSAND 010 +-#define FANCY 020 +-#define SHELLDIR 040 /* print shell's dir if not the same */ +-#define JOBDIR 0100 /* print job's dir if not the same */ +-#define AREASON 0200 ++#define NUMBER 0x001 ++#define NAME 0x002 ++#define REASON 0x004 ++#define AMPERSAND 0x008 ++#define FANCY 0x010 ++#define SHELLDIR 0x020 /* print shell's dir if not the same */ ++#define JOBDIR 0x040 /* print job's dir if not the same */ ++#define AREASON 0x080 ++#define JOBLIST 0x100 + + EXTERN struct process proclist IZERO_STRUCT;/* list head of all processes */ + +-- +2.5.5 + diff --git a/tcsh.spec b/tcsh.spec index 0c01cf8..6dbc833 100644 --- a/tcsh.spec +++ b/tcsh.spec @@ -57,6 +57,7 @@ Patch025: tcsh-6.19.00-025-more-generous-ROUNDUP-_LP64.patch Patch026: tcsh-6.19.00-026-quote-backslashes-properly.patch Patch027: tcsh-6.19.00-027-fix-memory-leak-when-cdpath-fails.patch Patch028: tcsh-6.19.00-028-fix-wrong-ifdef.patch +Patch029: tcsh-6.19.00-029-do-not-print-jobs-to-stderr.patch # Downstream patches -- these should be always included when doing rebase: @@ -178,6 +179,7 @@ fi * Fri May 27 2016 David Kaspar [Dee'Kej] - 6.19.00-9 - Another regression in tcsh-6.19.00-026-quote-backslashes-properly.patch fixed, see: +- tcsh-6.19.00-029-do-not-print-jobs-to-stderr.patch added * Mon May 16 2016 David Kaspar [Dee'Kej] - 6.19.00-8 - Regression in tcsh-6.19.00-026-quote-backslashes-properly.patch fixed (#1333523)