Fix negative number of jobs with %%j formatting parameter in prompt

This commit is contained in:
Vojtech Vitek (V-Teq) 2011-10-26 15:07:34 +02:00
parent d7f98751f7
commit ff523ef24c
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,13 @@
diff -up tcsh-6.17.00/tc.prompt.c.orig tcsh-6.17.00/tc.prompt.c
--- tcsh-6.17.00/tc.prompt.c.orig 2010-06-17 12:40:40.422571577 +0200
+++ tcsh-6.17.00/tc.prompt.c 2010-06-17 12:41:28.628519727 +0200
@@ -526,6 +526,9 @@ tprintf(int what, const Char *fmt, const
int njobs = -1;
struct process *pp;
+ if (!proclist.p_next)
+ njobs++;
+
for (pp = proclist.p_next; pp; pp = pp->p_next)
njobs++;
p = Itoa(njobs, 1, attributes);

View File

@ -23,6 +23,7 @@ Patch14: tcsh-6.17.00-history.patch
# Accepted by upstream:
Patch15: tcsh-6.17.00-printexitvalue.patch
Patch16: tcsh-6.17.00-testsuite.patch
Patch17: tcsh-6.17.00-negative_jobs.patch
# Accepted by upstream (tcsh-6.17.03b http://bugs.gw.com/view.php?id=109):
Patch19: tcsh-6.17.00-wait-intr.patch
# Accepted by upstream (tcsh-6.17.03b http://bugs.gw.com/view.php?id=112):
@ -68,6 +69,7 @@ like syntax.
%patch14 -p1 -b .history
%patch15 -p1 -b .printexitvalue
%patch16 -p1 -b .testsuite
%patch17 -p1 -b .negative_jobs
%patch19 -p1 -b .wait-intr
%patch21 -p1 -b .dont-set-empty-remotehost
%patch22 -p1 -b .dont-print-history-on-verbose
@ -147,6 +149,7 @@ fi
%{_mandir}/man1/*.1*
%changelog
- Fix negative number of jobs with %%j formatting parameter in prompt
- Clean-up patches numbers & order (prepare space for missing RHEL-6 patches)
- Disable obsolete glob-automount.patch; The issue should have been
(and is now) fixed in glibc (posix/glob.c)