remove unused patches from git
Version: 6.18.01-13
This commit is contained in:
parent
ed7c627f46
commit
2a7c9661bb
@ -1,77 +0,0 @@
|
||||
--- tcsh-6.14.00/sh.h.wide-seeks 2005-03-25 19:46:41.000000000 +0100
|
||||
+++ tcsh-6.14.00/sh.h 2006-09-26 18:26:33.000000000 +0200
|
||||
@@ -801,6 +801,13 @@
|
||||
* exactly one if the input is seekable and tell is available.
|
||||
* In other cases, the shell buffers enough blocks to keep all loops
|
||||
* in the buffer.
|
||||
+ *
|
||||
+ * If (WIDE_STRINGS && cantell), fbobp is always a byte offset, but
|
||||
+ * (fseekp - fbobp) and (feobp - fbobp) are character offsets (usable for
|
||||
+ * fbuf indexing).
|
||||
+ *
|
||||
+ * If (!cantell), all offsets are character offsets; if (!WIDE_STRINGS), there
|
||||
+ * is no difference between byte and character offsets.
|
||||
*/
|
||||
EXTERN struct Bin {
|
||||
off_t Bfseekp; /* Seek pointer, generally != lseek() value */
|
||||
@@ -824,7 +831,7 @@
|
||||
#define TCSH_F_SEEK 2 /* File seek */
|
||||
#define TCSH_E_SEEK 3 /* Eval seek */
|
||||
union {
|
||||
- off_t _f_seek;
|
||||
+ off_t _f_seek; /* A byte offset if (cantell) */
|
||||
Char* _c_seek;
|
||||
} fc;
|
||||
#define f_seek fc._f_seek
|
||||
--- tcsh-6.14.00/sh.lex.c.wide-seeks 2006-09-26 18:26:33.000000000 +0200
|
||||
+++ tcsh-6.14.00/sh.lex.c 2006-09-26 18:28:10.000000000 +0200
|
||||
@@ -1694,7 +1694,8 @@
|
||||
char cbuf[BUFSIZE + 1];
|
||||
ssize_t res, r;
|
||||
size_t partial;
|
||||
-
|
||||
+ int err;
|
||||
+
|
||||
assert (nchars <= sizeof(cbuf)/sizeof(*cbuf));
|
||||
USE(use_fclens);
|
||||
res = 0;
|
||||
@@ -1736,7 +1737,11 @@
|
||||
memmove(cbuf, cbuf + i, partial - i);
|
||||
partial -= i;
|
||||
} while (partial != 0 && nchars != 0);
|
||||
- /* Throwing away possible partial multibyte characters on error */
|
||||
+ /* Throwing away possible partial multibyte characters on error if the
|
||||
+ stream is not seekable */
|
||||
+ err = errno;
|
||||
+ lseek(fildes, -(off_t)partial, L_INCR);
|
||||
+ errno = err;
|
||||
return res != 0 ? res : r;
|
||||
}
|
||||
|
||||
@@ -1753,7 +1758,13 @@
|
||||
(void) lseek(SHIN, fseekp, L_SET);
|
||||
}
|
||||
if (fseekp == feobp) {
|
||||
- fbobp = feobp;
|
||||
+ off_t bytes;
|
||||
+ size_t i;
|
||||
+
|
||||
+ bytes = fbobp;
|
||||
+ for (i = 0; i < (size_t)(feobp - fbobp); i++)
|
||||
+ bytes += fclens[i];
|
||||
+ fbobp = fseekp = feobp = bytes;
|
||||
do
|
||||
c = wide_read(SHIN, fbuf[0], BUFSIZE, 1);
|
||||
while (c < 0 && errno == EINTR);
|
||||
@@ -1926,9 +1937,9 @@
|
||||
return;
|
||||
case TCSH_F_SEEK:
|
||||
#ifdef WIDE_STRINGS
|
||||
- if (cantell && fseekp >= fbobp && fseekp < feobp) {
|
||||
+ if (cantell && fseekp >= fbobp && fseekp <= feobp) {
|
||||
size_t i;
|
||||
-
|
||||
+
|
||||
l->f_seek = fbobp;
|
||||
for (i = 0; i < fseekp - fbobp; i++)
|
||||
l->f_seek += fclens[i];
|
@ -1,181 +0,0 @@
|
||||
diff -up tcsh-6.17.00/sh.glob.c.glob-automount tcsh-6.17.00/sh.glob.c
|
||||
--- tcsh-6.17.00/sh.glob.c.glob-automount 2008-06-19 17:20:56.000000000 +0200
|
||||
+++ tcsh-6.17.00/sh.glob.c 2009-11-04 13:58:09.000000000 +0100
|
||||
@@ -423,6 +423,14 @@ handleone(Char *str, Char **vl, int acti
|
||||
return (str);
|
||||
}
|
||||
|
||||
+static char **blkend(char **up)
|
||||
+{
|
||||
+
|
||||
+ while (*up)
|
||||
+ up++;
|
||||
+ return (up);
|
||||
+}
|
||||
+
|
||||
static Char **
|
||||
libglob(Char **vl)
|
||||
{
|
||||
@@ -430,6 +438,13 @@ libglob(Char **vl)
|
||||
glob_t globv;
|
||||
char *ptr;
|
||||
int nonomatch = adrof(STRnonomatch) != 0, magic = 0, match = 0;
|
||||
+ char **snowc = NULL;
|
||||
+ char **nowc;
|
||||
+ char **globres;
|
||||
+ char **sres;
|
||||
+ char **res;
|
||||
+ int size = GLOBSPACE;
|
||||
+ int cglob = 0, fglob = 0;
|
||||
|
||||
if (!vl || !vl[0])
|
||||
return(vl);
|
||||
@@ -438,35 +453,126 @@ libglob(Char **vl)
|
||||
globv.gl_pathv = 0;
|
||||
globv.gl_pathc = 0;
|
||||
|
||||
+ sres = res = (Char **) xmalloc((size_t) (size * sizeof(Char *)));
|
||||
+ *res = NULL;
|
||||
+
|
||||
if (nonomatch)
|
||||
gflgs |= GLOB_NOCHECK;
|
||||
|
||||
do {
|
||||
- ptr = short2qstr(*vl);
|
||||
- switch (glob(ptr, gflgs, 0, &globv)) {
|
||||
- case GLOB_ABEND:
|
||||
- globfree(&globv);
|
||||
- setname(ptr);
|
||||
- stderror(ERR_NAME | ERR_GLOB);
|
||||
- /* NOTREACHED */
|
||||
- case GLOB_NOSPACE:
|
||||
- globfree(&globv);
|
||||
- stderror(ERR_NOMEM);
|
||||
- /* NOTREACHED */
|
||||
- default:
|
||||
- break;
|
||||
- }
|
||||
- if (globv.gl_flags & GLOB_MAGCHAR) {
|
||||
- match |= (globv.gl_matchc != 0);
|
||||
- magic = 1;
|
||||
+ ptr = short2qstr(*vl);
|
||||
+ if (!any(ptr, '?') && !any(ptr, '*') && !any(ptr, '[') && !any(ptr, ']'))
|
||||
+ {
|
||||
+ ptr = short2str(*vl);
|
||||
+ if (snowc == NULL)
|
||||
+ snowc = nowc = (Char **) xmalloc((size_t) ((blklen(vl) + 1) * sizeof(Char *)));
|
||||
+ *nowc++ = SAVE(ptr);
|
||||
+ *nowc = NULL;
|
||||
+
|
||||
+ continue;
|
||||
+
|
||||
+ }
|
||||
+ else
|
||||
+ cglob++;
|
||||
+ switch (glob(ptr, gflgs, 0, &globv)) {
|
||||
+ case GLOB_ABEND:
|
||||
+ globfree(&globv);
|
||||
+ setname(ptr);
|
||||
+ stderror(ERR_NAME | ERR_GLOB);
|
||||
+ /* NOTREACHED */
|
||||
+ case GLOB_NOSPACE:
|
||||
+ globfree(&globv);
|
||||
+ stderror(ERR_NOMEM);
|
||||
+ /* NOTREACHED */
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+ if (globv.gl_flags & GLOB_MAGCHAR) {
|
||||
+ match |= (globv.gl_matchc != 0);
|
||||
+ magic = 1;
|
||||
+ }
|
||||
+
|
||||
+ globres = (globv.gl_pathc == 0 || (magic && !match && !nonomatch)) ?
|
||||
+ NULL : blk2short(globv.gl_pathv);
|
||||
+
|
||||
+ if (snowc != NULL)
|
||||
+ {
|
||||
+ while ((blklen(sres) + blklen(snowc)) >= size) {
|
||||
+ size += GLOBSPACE;
|
||||
+ sres = (Char **) xrealloc((ptr_t) sres, (size_t) (size * sizeof(Char *)));
|
||||
+ }
|
||||
+
|
||||
+ if (blklen(sres) == 0)
|
||||
+ {
|
||||
+ sres = blkcpy(sres, snowc);
|
||||
+ res = blkend(sres);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ res = blkend(sres);
|
||||
+ res = blkcpy(res, snowc);
|
||||
+ }
|
||||
+ xfree(snowc);
|
||||
+ snowc = NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (globres != NULL)
|
||||
+ {
|
||||
+ while ((blklen(sres) + blklen(globres)) >= size) {
|
||||
+ size += GLOBSPACE;
|
||||
+ sres = (Char **) xrealloc((ptr_t) sres, (size_t) (size * sizeof(Char *)));
|
||||
+ }
|
||||
+
|
||||
+ if (blklen(sres) == 0)
|
||||
+ {
|
||||
+ sres = blkcpy(sres, globres);
|
||||
+ res = blkend(sres);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ res = blkend(sres);
|
||||
+ res = blkcpy(res, globres);
|
||||
+ }
|
||||
+ xfree(globres);
|
||||
+ globres = NULL;
|
||||
}
|
||||
- gflgs |= GLOB_APPEND;
|
||||
+ else
|
||||
+ fglob++;
|
||||
+
|
||||
+ globfree(&globv);
|
||||
}
|
||||
while (*++vl);
|
||||
- vl = (globv.gl_pathc == 0 || (magic && !match && !nonomatch)) ?
|
||||
- NULL : blk2short(globv.gl_pathv);
|
||||
- globfree(&globv);
|
||||
- return (vl);
|
||||
+
|
||||
+ if (snowc != NULL)
|
||||
+ {
|
||||
+ while ((blklen(sres) + blklen(snowc)) >= size) {
|
||||
+ size += GLOBSPACE;
|
||||
+ sres = (Char **) xrealloc((ptr_t) sres, (size_t) (size * sizeof(Char *)));
|
||||
+ }
|
||||
+
|
||||
+ if (blklen(sres) == 0)
|
||||
+ {
|
||||
+ sres = blkcpy(sres, snowc);
|
||||
+ res = blkend(sres);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ res = blkend(sres);
|
||||
+ res = blkcpy(res, snowc);
|
||||
+ }
|
||||
+ xfree(snowc);
|
||||
+ snowc = NULL;
|
||||
+ }
|
||||
+
|
||||
+ if ((cglob != 0) && (cglob == fglob))
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (blklen(sres) != 0)
|
||||
+ vl = saveblk(sres);
|
||||
+ else
|
||||
+ vl = NULL;
|
||||
+
|
||||
+ return vl;
|
||||
}
|
||||
|
||||
Char *
|
@ -1,55 +0,0 @@
|
||||
diff -upr tcsh-6.18.00_orig/ed.chared.c tcsh-6.18.00_work/ed.chared.c
|
||||
--- tcsh-6.18.00_orig/ed.chared.c 2013-03-28 10:26:00.801939093 +0100
|
||||
+++ tcsh-6.18.00_work/ed.chared.c 2013-03-28 10:30:37.000000000 +0100
|
||||
@@ -957,6 +957,7 @@ GetHistLine()
|
||||
{
|
||||
struct Hist *hp;
|
||||
int h;
|
||||
+ int history;
|
||||
|
||||
if (Hist_num == 0) { /* if really the current line */
|
||||
if (HistBuf.s != NULL)
|
||||
@@ -979,8 +980,10 @@ GetHistLine()
|
||||
if (hp == NULL)
|
||||
return(CC_ERROR);
|
||||
|
||||
+ /* access only $history commands */
|
||||
+ history = getn(varval(STRhistory));
|
||||
for (h = 1; h < Hist_num; h++) {
|
||||
- if ((hp->Hnext) == NULL) {
|
||||
+ if ((hp->Hnext) == NULL || h >= history) {
|
||||
Hist_num = h;
|
||||
return(CC_ERROR);
|
||||
}
|
||||
diff -upr tcsh-6.18.00_orig/sh.hist.c tcsh-6.18.00_work/sh.hist.c
|
||||
--- tcsh-6.18.00_orig/sh.hist.c 2013-03-28 10:26:00.794939068 +0100
|
||||
+++ tcsh-6.18.00_work/sh.hist.c 2013-03-28 10:25:19.000000000 +0100
|
||||
@@ -138,6 +138,7 @@ savehist(
|
||||
int flg)
|
||||
{
|
||||
int histlen = 0;
|
||||
+ int savehist = 0;
|
||||
Char *cp;
|
||||
|
||||
/* throw away null lines */
|
||||
@@ -151,6 +152,20 @@ savehist(
|
||||
}
|
||||
histlen = histlen * 10 + *cp++ - '0';
|
||||
}
|
||||
+
|
||||
+ /* check savehist and history and use greater value to store all commands */
|
||||
+ cp = varval(STRsavehist);
|
||||
+ while (*cp) {
|
||||
+ if (!Isdigit(*cp)) {
|
||||
+ savehist = 0;
|
||||
+ break;
|
||||
+ }
|
||||
+ savehist = savehist * 10 + *cp++ - '0';
|
||||
+ }
|
||||
+
|
||||
+ if (savehist > histlen)
|
||||
+ histlen = savehist;
|
||||
+
|
||||
if (sp)
|
||||
(void) enthist(++eventno, sp, 1, flg, histlen);
|
||||
discardExcess(histlen, flg);
|
Loading…
Reference in New Issue
Block a user