Fix UTF-8 Japanese character is garbled in tcsh script in a certain

situation, Fix calculation order of operators description in tcsh
    manpage, Fix strings which begin with '0' are not recognized as octal
    numbers, Fix memoryuse description in tcsh manpage, Fix tcsh scripts
    with multiple case statement with end keywords break with error, Fix
    description of builtin command 'set' in tcsh manpage
This commit is contained in:
vcrhonek 2008-09-03 11:50:36 +00:00
parent 5b0f4da405
commit 1bcd8ea591
7 changed files with 164 additions and 1 deletions

View File

@ -0,0 +1,13 @@
diff -up tcsh-6.15.00/tcsh.man.memoryuse tcsh-6.15.00/tcsh.man
--- tcsh-6.15.00/tcsh.man.memoryuse 2008-09-03 12:16:48.000000000 +0200
+++ tcsh-6.15.00/tcsh.man 2008-09-03 12:16:48.000000000 +0200
@@ -2901,7 +2901,8 @@ the size of the largest core dump that w
.TP
\fImemoryuse\fR
the maximum amount of physical memory a process
-may have allocated to it at a given time
+may have allocated to it at a given time (this is not implemented in the 2.6 kernel. The value is meaningless
+and changing this value will have no effect)
.TP
\fIheapsize\fR
the maximum amount of memory a process

32
tcsh-6.14.00-octal.patch Normal file
View File

@ -0,0 +1,32 @@
diff -up tcsh-6.15.00/sh.set.c.octal tcsh-6.15.00/sh.set.c
--- tcsh-6.15.00/sh.set.c.octal 2006-08-24 22:56:31.000000000 +0200
+++ tcsh-6.15.00/sh.set.c 2008-09-03 12:28:10.000000000 +0200
@@ -525,6 +525,7 @@ getn(Char *cp)
{
int n;
int sign;
+ int base;
if (!cp) /* PWP: extra error checking */
stderror(ERR_NAME | ERR_BADNUM);
@@ -538,9 +539,19 @@ getn(Char *cp)
if (!Isdigit(*cp))
stderror(ERR_NAME | ERR_BADNUM);
}
+
+ if (cp[0] == '0' && cp[1])
+ base = 8;
+ else
+ base = 10;
+
n = 0;
while (Isdigit(*cp))
- n = n * 10 + *cp++ - '0';
+ {
+ if (base == 8 && *cp >= '8')
+ stderror(ERR_NAME | ERR_BADNUM);
+ n = n * base + *cp++ - '0';
+ }
if (*cp)
stderror(ERR_NAME | ERR_BADNUM);
return (sign ? -n : n);

14
tcsh-6.14.00-order.patch Normal file
View File

@ -0,0 +1,14 @@
diff -up tcsh-6.15.00/tcsh.man.order tcsh-6.15.00/tcsh.man
--- tcsh-6.15.00/tcsh.man.order 2008-09-03 12:30:44.000000000 +0200
+++ tcsh-6.15.00/tcsh.man 2008-09-03 12:30:44.000000000 +0200
@@ -1614,7 +1614,9 @@ They include
.PP
Here the precedence increases to the right, `==' `!=' `=~' and `!~', `<='
`>=' `<' and `>', `<<' and `>>', `+' and `\-', `*' `/' and `%' being, in
-groups, at the same level. The `==' `!=' `=~' and `!~' operators compare
+groups, at the same level. When multiple operators which have same precedence
+are used in one expression, calculation must be done from operator of right
+side. The `==' `!=' `=~' and `!~' operators compare
their arguments as strings; all others operate on numbers. The operators
`=~' and `!~' are like `!=' and `==' except that the right hand side is a
glob-pattern (see \fBFilename substitution\fR) against which the left hand

11
tcsh-6.14.00-set.patch Normal file
View File

@ -0,0 +1,11 @@
diff -up tcsh-6.15.00/tcsh.man.set tcsh-6.15.00/tcsh.man
--- tcsh-6.15.00/tcsh.man.set 2008-09-03 11:43:55.000000000 +0200
+++ tcsh-6.15.00/tcsh.man 2008-09-03 11:43:55.000000000 +0200
@@ -3213,7 +3213,6 @@ The fifth form sets the \fIindex\fR'th c
this component must already exist.
The sixth form lists only the names of all shell variables that are read-only.
The seventh form makes \fIname\fR read-only, whether or not it has a value.
-The second form sets \fIname\fR to the null string.
The eighth form is the same as the third form, but
make \fIname\fR read-only at the same time.
.PD

37
tcsh-6.14.00-syntax.patch Normal file
View File

@ -0,0 +1,37 @@
diff -up tcsh-6.15.00/sh.func.c.syntax tcsh-6.15.00/sh.func.c
--- tcsh-6.15.00/sh.func.c.syntax 2006-08-24 22:56:31.000000000 +0200
+++ tcsh-6.15.00/sh.func.c 2008-09-03 11:53:05.000000000 +0200
@@ -751,8 +751,6 @@ search(int type, int level, Char *goal)
{
struct Strbuf word = Strbuf_INIT;
Char *cp;
- struct whyle *wp;
- int wlevel = 0;
Stype = type;
Sgoal = goal;
@@ -791,24 +789,13 @@ search(int type, int level, Char *goal)
case TC_FOREACH:
case TC_WHILE:
- wlevel++;
if (type == TC_BREAK)
level++;
break;
case TC_END:
- if (type == TC_BRKSW) {
- if (wlevel == 0) {
- wp = whyles;
- if (wp) {
- whyles = wp->w_next;
- wpfree(wp);
- }
- }
- }
if (type == TC_BREAK)
level--;
- wlevel--;
break;
case TC_SWITCH:

View File

@ -0,0 +1,28 @@
diff -up tcsh-6.15.00/tc.str.c_old tcsh-6.15.00/tc.str.c
--- tcsh-6.15.00/tc.str.c_old 2008-09-03 13:08:44.000000000 +0200
+++ tcsh-6.15.00/tc.str.c 2008-09-03 13:11:32.000000000 +0200
@@ -154,7 +154,7 @@ short2str(const Char *src)
{
static char *sdst = NULL;
static size_t dstsize = 0;
- char *dst, *edst;
+ char *dst, *edst, *wdst, *wedst;
if (src == NULL)
return (NULL);
@@ -171,8 +171,15 @@ short2str(const Char *src)
if (dst >= edst) {
dstsize += MALLOC_INCR;
sdst = xrealloc(sdst, (dstsize + MALLOC_SURPLUS) * sizeof(char));
+ wdst = dst;
+ wedst = edst;
edst = &sdst[dstsize];
dst = &edst[-MALLOC_INCR];
+ while (wdst > wedst) {
+ dst++;
+ wdst--;
+ }
+
}
}
*dst = 0;

View File

@ -3,7 +3,7 @@
Summary: An enhanced version of csh, the C shell
Name: tcsh
Version: 6.15
Release: 5%{?dist}
Release: 6%{?dist}
License: BSD with advertising
Group: System Environment/Shells
Source: ftp://ftp.astron.com/pub/tcsh/tcsh-%{version}.00.tar.gz
@ -13,6 +13,12 @@ Patch3: tcsh-6.14.00-unprintable.patch
Patch4: tcsh-6.15.00-hist-sub.patch
Patch5: tcsh-6.15.00-var-sub.patch
Patch6: tcsh-6.15.00-ca-color.patch
Patch7: tcsh-6.14.00-set.patch
Patch8: tcsh-6.14.00-syntax.patch
Patch9: tcsh-6.13.00-memoryuse.patch
Patch10: tcsh-6.14.00-octal.patch
Patch11: tcsh-6.14.00-order.patch
Patch12: tcsh-6.15.00-wide-str.patch
Provides: csh = %{version}
Requires(post): grep
Requires(postun): coreutils, grep
@ -36,6 +42,12 @@ like syntax.
%patch4 -p1 -b .hist-sub
%patch5 -p1 -b .var-sub
%patch6 -p1 -b .ca-color
%patch7 -p1 -b .set
%patch8 -p1 -b .syntax
%patch9 -p1 -b .memoryuse
%patch10 -p1 -b .octal
%patch11 -p1 -b .order
%patch12 -p1 -b .wide-str
%build
# For tcsh-6.14.00-tinfo.patch
@ -103,6 +115,22 @@ fi
%{_mandir}/*/*
%changelog
* Wed Sep 3 2008 Vitezslav Crhonek <vcrhonek@redhat.com> - 6.15-6
- Fix UTF-8 Japanese character is garbled in tcsh script in
a certain situation
Related: #453785
- Fix calculation order of operators description in tcsh manpage
Related: #442536
- Fix strings which begin with '0' are not recognized as octal numbers
Related: #438109
- Fix memoryuse description in tcsh manpage
Related: #437095
- Fix tcsh scripts with multiple case statement with end keywords
break with error
Related: #436956
- Fix description of builtin command 'set' in tcsh manpage
Related: #430459
* Fri Aug 29 2008 Vitezslav Crhonek <vcrhonek@redhat.com> - 6.15-5
- Rediffed all patches to work with patch --fuzz=0
- Let tcsh know 'ca' colorls variable