.
OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=141
This commit is contained in:
parent
f0b83887ef
commit
470614d377
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 30 11:17:34 UTC 2013 - werner@suse.de
|
||||
|
||||
- Finally found the reason for bnc#795324, that is avoid to free
|
||||
data which is used lateron in the has tree of reloaded shell
|
||||
functions.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 17 11:19:59 UTC 2013 - werner@suse.de
|
||||
|
||||
|
2
ksh.spec
2
ksh.spec
@ -582,7 +582,7 @@ fi
|
||||
$bin --nroff 2>&1 | sed 's/\(\.TH .*\)/\1 "%{date}" "" "Korn shell utilities"/' > ../man/man1/$bin.1
|
||||
done
|
||||
popd
|
||||
test -d /tmp -ef ${TMPDIR} || rm -rf ${TMPDIR}
|
||||
test -d /tmp -a /tmp -ef ${TMPDIR} || rm -rf ${TMPDIR}
|
||||
SHELL=$OSHELL
|
||||
PATH=$OPATH
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
--- src/lib/libast/cdt/dtcomp.c 2011-10-24 20:23:26.000000000 +0000
|
||||
--- src/lib/libast/cdt/dtcomp.c
|
||||
+++ src/lib/libast/cdt/dtcomp.c 2012-12-20 10:29:45.005452948 +0000
|
||||
@@ -52,9 +52,3 @@ extern ssize_t dtsize(Dt_t* d)
|
||||
{
|
||||
@ -10,7 +10,7 @@
|
||||
-{
|
||||
- return (ssize_t)(*(_DT(d)->searchf))((d),(Void_t*)(0),DT_STAT);
|
||||
-}
|
||||
--- src/lib/libast/cdt/dtdisc.c 2011-10-04 20:58:38.000000000 +0000
|
||||
--- src/lib/libast/cdt/dtdisc.c
|
||||
+++ src/lib/libast/cdt/dtdisc.c 2012-12-20 10:29:45.013452595 +0000
|
||||
@@ -57,7 +57,6 @@ Dtdisc_t* disc;
|
||||
int type;
|
||||
@ -29,7 +29,7 @@
|
||||
if(old->eventf && (*old->eventf)(dt,DT_DISC,(Void_t*)disc,old) < 0)
|
||||
return NIL(Dtdisc_t*);
|
||||
|
||||
--- src/lib/libast/cdt/dthash.c 2011-12-16 05:06:27.000000000 +0000
|
||||
--- src/lib/libast/cdt/dthash.c
|
||||
+++ src/lib/libast/cdt/dthash.c 2012-12-20 10:29:45.013452595 +0000
|
||||
@@ -52,11 +52,13 @@ static int htable(Dt_t* dt)
|
||||
if((n = hash->tblz) > 0 && (hash->type&H_FIXED) )
|
||||
@ -119,7 +119,7 @@
|
||||
DTRETURN(obj, NIL(Void_t*));
|
||||
|
||||
do_insert: /* inserting a new object */
|
||||
--- src/lib/libast/cdt/dtlist.c 2011-11-08 19:37:25.000000000 +0000
|
||||
--- src/lib/libast/cdt/dtlist.c
|
||||
+++ src/lib/libast/cdt/dtlist.c 2012-12-20 10:29:45.013452595 +0000
|
||||
@@ -142,9 +142,9 @@ int type;
|
||||
}
|
||||
@ -248,7 +248,7 @@
|
||||
+
|
||||
+ return sz;
|
||||
+}
|
||||
--- src/lib/libast/cdt/dtstrhash.c 2011-09-28 03:43:49.000000000 +0000
|
||||
--- src/lib/libast/cdt/dtstrhash.c
|
||||
+++ src/lib/libast/cdt/dtstrhash.c 2012-12-20 10:29:45.021452290 +0000
|
||||
@@ -22,40 +22,38 @@
|
||||
#include "dthdr.h"
|
||||
@ -309,7 +309,7 @@
|
||||
+
|
||||
+ return h;
|
||||
}
|
||||
--- src/lib/libast/cdt/dttree.c 2011-12-16 05:06:36.000000000 +0000
|
||||
--- src/lib/libast/cdt/dttree.c
|
||||
+++ src/lib/libast/cdt/dttree.c 2012-12-20 10:29:45.029525330 +0000
|
||||
@@ -545,7 +545,14 @@ int type;
|
||||
}
|
||||
@ -503,3 +503,99 @@
|
||||
#define dtsize(d) (ssize_t)(*(_DT(d)->searchf))((d),(Void_t*)(0),DT_STAT)
|
||||
|
||||
#define DT_PRIME 17109811 /* 2#00000001 00000101 00010011 00110011 */
|
||||
--- src/lib/libast/Mamfile
|
||||
+++ src/lib/libast/Mamfile 2013-01-30 10:01:13.201453447 +0000
|
||||
@@ -3966,6 +3966,14 @@ meta dtopen.o %.c>%.o cdt/dtopen.c dtope
|
||||
prev cdt/dtopen.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c cdt/dtopen.c
|
||||
done dtopen.o generated
|
||||
+make dtstat.o
|
||||
+make cdt/dtstat.c
|
||||
+prev cdt/dthdr.h implicit
|
||||
+done cdt/dtstat.c
|
||||
+meta dtstat.o %.c>%.o cdt/dtstat.c dtstat
|
||||
+prev cdt/dtstat.c
|
||||
+exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c cdt/dtstat.c
|
||||
+done dtstat.o generated
|
||||
make dtstrhash.o
|
||||
make cdt/dtstrhash.c
|
||||
prev cdt/dthdr.h implicit
|
||||
@@ -3982,6 +3990,14 @@ meta dttree.o %.c>%.o cdt/dttree.c dttre
|
||||
prev cdt/dttree.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c cdt/dttree.c
|
||||
done dttree.o generated
|
||||
+make dtuser.o
|
||||
+make cdt/dtuser.c
|
||||
+prev cdt/dthdr.h implicit
|
||||
+done cdt/dtuser.c
|
||||
+meta dtuser.o %.c>%.o cdt/dtuser.c dtuser
|
||||
+prev cdt/dtuser.c
|
||||
+exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c cdt/dtuser.c
|
||||
+done dtuser.o generated
|
||||
make dtview.o
|
||||
make cdt/dtview.c
|
||||
prev cdt/dthdr.h implicit
|
||||
@@ -6091,7 +6107,7 @@ exec - ${AR} rc libast.a state.o transit
|
||||
exec - ${AR} rc libast.a streval.o strexpr.o strmatch.o strcopy.o modei.o modex.o strmode.o strlcat.o strlcpy.o strlook.o strncopy.o strsearch.o strpsearch.o stresc.o stropt.o strtape.o strpcmp.o strnpcmp.o strvcmp.o strnvcmp.o tok.o tokline.o tokscan.o pathaccess.o pathcat.o pathcanon.o pathcheck.o pathpath.o pathexists.o pathfind.o pathkey.o pathprobe.o pathrepl.o pathnative.o pathposix.o pathtemp.o pathtmp.o pathstat.o pathgetlink.o pathsetlink.o pathbin.o pathshell.o pathcd.o pathprog.o fs3d.o ftwalk.o ftwflags.o fts.o astintercept.o conformance.o getenv.o setenviron.o optget.o optjoin.o optesc.o optctx.o strsort.o struniq.o magic.o mime.o mimetype.o signal.o sigflag.o systrace.o error.o errorf.o errormsg.o errorx.o localeconv.o setlocale.o translate.o catopen.o iconv.o lc.o lctab.o mc.o base64.o recfmt.o recstr.o reclen.o fmtrec.o fmtbase.o fmtbuf.o fmtclock.o fmtdev.o fmtelapsed.o fmterror.o fmtesc.o fmtfmt.o fmtfs.o fmtident.o fmtint.o fmtip4.o fmtip6.o fmtls.o fmtmatch.o fmtmode.o fmtnum.o fmtperm.o fmtre.o fmttime.o
|
||||
exec - ${AR} rc libast.a fmtuid.o fmtgid.o fmtsignal.o fmtscale.o fmttmx.o fmttv.o fmtversion.o strelapsed.o strperm.o struid.o strgid.o strtoip4.o strtoip6.o stack.o stk.o swapget.o swapmem.o swapop.o swapput.o sigdata.o sigcrit.o sigunblock.o procopen.o procclose.o procrun.o procfree.o tmdate.o tmequiv.o tmfix.o tmfmt.o tmform.o tmgoff.o tminit.o tmleap.o tmlex.o tmlocale.o tmmake.o tmpoff.o tmscan.o tmsleep.o tmtime.o tmtype.o tmweek.o tmword.o tmzone.o tmxdate.o tmxduration.o tmxfmt.o tmxgettime.o tmxleap.o tmxmake.o tmxscan.o tmxsettime.o tmxsleep.o tmxtime.o tmxtouch.o tvcmp.o tvgettime.o tvsettime.o tvsleep.o tvtouch.o cmdarg.o vecargs.o vecfile.o vecfree.o vecload.o vecstring.o univdata.o touch.o mnt.o debug.o memccpy.o memchr.o memcmp.o memcpy.o memdup.o memmove.o memset.o mkdir.o mkfifo.o mknod.o rmdir.o remove.o rename.o link.o unlink.o strdup.o strchr.o strrchr.o strstr.o strtod.o strtold.o strtol.o strtoll.o strtoul.o strtoull.o strton.o strtonll.o strntod.o strntold.o strnton.o
|
||||
exec - ${AR} rc libast.a strntonll.o strntol.o strntoll.o strntoul.o strntoull.o strcasecmp.o strncasecmp.o strerror.o mktemp.o tmpnam.o fsync.o execlp.o execve.o execvp.o execvpe.o spawnveg.o vfork.o killpg.o hsearch.o tsearch.o getlogin.o putenv.o setenv.o unsetenv.o lstat.o statvfs.o eaccess.o gross.o omitted.o readlink.o symlink.o getpgrp.o setpgid.o setsid.o waitpid.o creat64.o fcntl.o open.o atexit.o getdents.o getwd.o dup2.o errno.o getpreroot.o ispreroot.o realopen.o setpreroot.o getgroups.o mount.o system.o iblocks.o modedata.o tmdata.o memfatal.o sfkeyprintf.o sfdcdio.o sfdcdos.o sfdcfilter.o sfdcseekable.o sfdcslow.o sfdcsubstr.o sfdctee.o sfdcunion.o sfdcmore.o sfdcprefix.o wc.o wc2utf8.o basename.o closelog.o dirname.o fmtmsglib.o fnmatch.o ftw.o getdate.o getsubopt.o glob.o nftw.o openlog.o re_comp.o resolvepath.o realpath.o regcmp.o regexp.o setlogmask.o strftime.o strptime.o swab.o syslog.o tempnam.o wordexp.o mktime.o regalloc.o regclass.o regcoll.o regcomp.o regcache.o regdecomp.o regerror.o regexec.o regfatal.o reginit.o
|
||||
-exec - ${AR} rc libast.a regnexec.o regsubcomp.o regsubexec.o regsub.o regrecord.o regrexec.o regstat.o dtclose.o dtdisc.o dthash.o dtlist.o dtmethod.o dtopen.o dtstrhash.o dttree.o dtview.o dtwalk.o dtnew.o dtcomp.o sfclose.o sfclrlock.o sfdisc.o sfdlen.o sfexcept.o sfgetl.o sfgetu.o sfcvt.o sfecvt.o sffcvt.o sfextern.o sffilbuf.o sfflsbuf.o sfprints.o sfgetd.o sfgetr.o sfllen.o sfmode.o sfmove.o sfnew.o sfpkrd.o sfnotify.o sfnputc.o sfopen.o sfpeek.o sfpoll.o sfpool.o sfpopen.o sfprintf.o sfputd.o sfputl.o sfputr.o sfputu.o sfrd.o sfread.o sfreserve.o sfscanf.o sfseek.o sfset.o sfsetbuf.o sfsetfd.o sfsize.o sfsk.o sfstack.o sfstrtod.o sfsync.o sfswap.o sftable.o sftell.o sftmp.o sfungetc.o sfvprintf.o sfvscanf.o sfwr.o sfwrite.o sfpurge.o sfraise.o sfwalk.o sfgetm.o sfmutex.o sfputm.o sfresize.o _sfclrerr.o _sfeof.o _sferror.o _sffileno.o _sfopen.o _sfstacked.o _sfvalue.o _sfgetc.o _sfgetl.o _sfgetl2.o _sfgetu.o _sfgetu2.o _sfdlen.o _sfllen.o _sfslen.o _sfulen.o _sfputc.o _sfputd.o _sfputl.o _sfputm.o
|
||||
+exec - ${AR} rc libast.a regnexec.o regsubcomp.o regsubexec.o regsub.o regrecord.o regrexec.o regstat.o dtclose.o dtdisc.o dthash.o dtlist.o dtmethod.o dtopen.o dtstat.o dtstrhash.o dttree.o dtuser.o dtview.o dtwalk.o dtnew.o dtcomp.o sfclose.o sfclrlock.o sfdisc.o sfdlen.o sfexcept.o sfgetl.o sfgetu.o sfcvt.o sfecvt.o sffcvt.o sfextern.o sffilbuf.o sfflsbuf.o sfprints.o sfgetd.o sfgetr.o sfllen.o sfmode.o sfmove.o sfnew.o sfpkrd.o sfnotify.o sfnputc.o sfopen.o sfpeek.o sfpoll.o sfpool.o sfpopen.o sfprintf.o sfputd.o sfputl.o sfputr.o sfputu.o sfrd.o sfread.o sfreserve.o sfscanf.o sfseek.o sfset.o sfsetbuf.o sfsetfd.o sfsize.o sfsk.o sfstack.o sfstrtod.o sfsync.o sfswap.o sftable.o sftell.o sftmp.o sfungetc.o sfvprintf.o sfvscanf.o sfwr.o sfwrite.o sfpurge.o sfraise.o sfwalk.o sfgetm.o sfmutex.o sfputm.o sfresize.o _sfclrerr.o _sfeof.o _sferror.o _sffileno.o _sfopen.o _sfstacked.o _sfvalue.o _sfgetc.o _sfgetl.o _sfgetl2.o _sfgetu.o _sfgetu2.o _sfdlen.o _sfllen.o _sfslen.o _sfulen.o _sfputc.o _sfputd.o _sfputl.o _sfputm.o
|
||||
exec - ${AR} rc libast.a _sfputu.o clearerr.o fclose.o fdopen.o feof.o ferror.o fflush.o fgetc.o fgetpos.o fgets.o fileno.o fopen.o fprintf.o fpurge.o fputc.o fputs.o fread.o freopen.o fscanf.o fseek.o fseeko.o fsetpos.o ftell.o ftello.o fwrite.o flockfile.o ftrylockfile.o funlockfile.o getc.o getchar.o getw.o pclose.o popen.o printf.o putc.o putchar.o puts.o putw.o rewind.o scanf.o setbuf.o setbuffer.o setlinebuf.o setvbuf.o snprintf.o sprintf.o sscanf.o asprintf.o vasprintf.o tmpfile.o ungetc.o vfprintf.o vfscanf.o vprintf.o vscanf.o vsnprintf.o vsprintf.o vsscanf.o _doprnt.o _doscan.o _filbuf.o _flsbuf.o _stdfun.o _stdopen.o _stdprintf.o _stdscanf.o _stdsprnt.o _stdvbuf.o _stdvsnprnt.o _stdvsprnt.o _stdvsscn.o fgetwc.o fwprintf.o putwchar.o vfwscanf.o wprintf.o fgetws.o fwscanf.o swprintf.o vswprintf.o wscanf.o fputwc.o getwc.o swscanf.o vswscanf.o fputws.o getwchar.o ungetwc.o vwprintf.o fwide.o putwc.o vfwprintf.o vwscanf.o stdio_c99.o fcloseall.o fmemopen.o getdelim.o getline.o frexp.o frexpl.o astcopy.o
|
||||
exec - ${AR} rc libast.a astconf.o astdynamic.o astlicense.o astquery.o astwinsize.o conftab.o aststatic.o getopt.o getoptl.o aso.o asolock.o asometh.o asorelax.o aso-sem.o aso-fcntl.o vmbest.o vmclear.o vmclose.o vmdcheap.o vmdebug.o vmdisc.o vmexit.o vmlast.o vmopen.o vmpool.o vmprivate.o vmprofile.o vmregion.o vmsegment.o vmset.o vmstat.o vmstrdup.o vmtrace.o vmwalk.o vmmopen.o malloc.o vmgetmem.o a64l.o acosh.o asinh.o atanh.o cbrt.o crypt.o erf.o err.o exp.o exp__E.o expm1.o gamma.o getpass.o lgamma.o log.o log1p.o log__L.o rand48.o random.o rcmd.o rint.o support.o sfstrtmp.o spawn.o
|
||||
exec - (ranlib libast.a) >/dev/null 2>&1 || true
|
||||
--- src/cmd/ksh93/sh/xec.c
|
||||
+++ src/cmd/ksh93/sh/xec.c 2013-01-30 08:52:32.000000000 +0000
|
||||
@@ -2661,24 +2661,25 @@ int sh_exec(register const Shnode_t *t,
|
||||
slp = (struct slnod*)np->nvenv;
|
||||
sh_funstaks(slp->slchild,-1);
|
||||
stakdelete(slp->slptr);
|
||||
- if(shp->funload)
|
||||
- {
|
||||
- free((void*)np->nvalue.rp);
|
||||
- np->nvalue.rp = 0;
|
||||
- }
|
||||
if(rp->sdict)
|
||||
{
|
||||
Namval_t *mp, *nq;
|
||||
shp->last_root = rp->sdict;
|
||||
for(mp=(Namval_t*)dtfirst(rp->sdict);mp;mp=nq)
|
||||
{
|
||||
- nq = dtnext(rp->sdict,mp);
|
||||
_nv_unset(mp,NV_RDONLY);
|
||||
+ nq = dtnext(rp->sdict,mp);
|
||||
nv_delete(mp,rp->sdict,0);
|
||||
}
|
||||
dtclose(rp->sdict);
|
||||
rp->sdict = 0;
|
||||
}
|
||||
+ if(shp->funload)
|
||||
+ {
|
||||
+ if(!shp->fpathdict)
|
||||
+ free((void*)np->nvalue.rp);
|
||||
+ np->nvalue.rp = 0;
|
||||
+ }
|
||||
}
|
||||
if(!np->nvalue.rp)
|
||||
{
|
||||
@@ -2689,7 +2690,7 @@ int sh_exec(register const Shnode_t *t,
|
||||
{
|
||||
static Dtdisc_t _Rpdisc =
|
||||
{
|
||||
- offsetof(struct Ufunction,fname), -1, sizeof(struct Ufunction)
|
||||
+ offsetof(struct Ufunction,fname), -1, sizeof(struct Ufunction)
|
||||
};
|
||||
struct functnod *fp;
|
||||
struct comnod *ac = t->funct.functargs;
|
||||
@@ -2716,8 +2717,10 @@ int sh_exec(register const Shnode_t *t,
|
||||
rp->np = np;
|
||||
if(!shp->fpathdict)
|
||||
shp->fpathdict = dtopen(&_Rpdisc,Dtobag);
|
||||
- if(shp->fpathdict)
|
||||
+ if(shp->fpathdict) {
|
||||
+ dtuserdata(shp->fpathdict,shp,1);
|
||||
dtinsert(shp->fpathdict,rp);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -39,3 +39,69 @@
|
||||
/*
|
||||
* search for an include file
|
||||
* if (flags&SEARCH_INCLUDE) then
|
||||
--- src/lib/libcmd/Mamfile
|
||||
+++ src/lib/libcmd/Mamfile 2013-01-28 10:46:23.141952570 +0000
|
||||
@@ -429,6 +429,7 @@ make uniq.c
|
||||
prev cmd.h implicit
|
||||
done uniq.c
|
||||
make vmstate.c
|
||||
+prev ${PACKAGE_ast_INCLUDE}/sfdisc.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit
|
||||
prev cmd.h implicit
|
||||
done vmstate.c
|
||||
--- src/lib/libast/misc/optget.c
|
||||
+++ src/lib/libast/misc/optget.c 2013-01-28 14:52:53.069452260 +0000
|
||||
@@ -2406,7 +2406,6 @@ opthelp(const char* oopts, const char* w
|
||||
int bflags = 0;
|
||||
int dflags = 0;
|
||||
int hflags = 0;
|
||||
- int sflags = 0;
|
||||
int matched = 0;
|
||||
int paragraph = 0;
|
||||
Push_t* psp = 0;
|
||||
@@ -4368,9 +4367,9 @@ optget(register char** argv, const char*
|
||||
*/
|
||||
|
||||
opt_info.assignment = 0;
|
||||
- num = 1;
|
||||
- w = v = 0;
|
||||
- x = 0;
|
||||
+ nov = no = num = 1;
|
||||
+ e = w = v = 0;
|
||||
+ n = x = 0;
|
||||
for (;;)
|
||||
{
|
||||
if (!opt_info.offset)
|
||||
@@ -4609,6 +4608,7 @@ optget(register char** argv, const char*
|
||||
opt_info.num = (long)(opt_info.number = optnumber(opt_info.arg, &e, &err));
|
||||
if (err || e == opt_info.arg)
|
||||
{
|
||||
+ opt_info.num = (long)(opt_info.number = 0);
|
||||
if (!err && (k & OPT_cache_optional))
|
||||
{
|
||||
opt_info.arg = 0;
|
||||
@@ -4636,6 +4636,7 @@ optget(register char** argv, const char*
|
||||
opt_info.arg = 0;
|
||||
opt_info.index--;
|
||||
opt_info.offset = 0;
|
||||
+ opt_info.num = (long)(opt_info.number = 0);
|
||||
return c;
|
||||
}
|
||||
if (k & OPT_cache_string)
|
||||
@@ -5213,7 +5214,7 @@ optget(register char** argv, const char*
|
||||
|
||||
if (opt_info.num != LONG_MIN)
|
||||
opt_info.num = (long)(opt_info.number = num);
|
||||
- if ((n = *++s == '#') || *s == ':' || w && !nov && v && (optnumber(v, &e, NiL), n = !*e))
|
||||
+ if ((n = (*++s == '#')) || *s == ':' || w && !nov && v && (optnumber(v, &e, NiL), n = !*e))
|
||||
{
|
||||
if (w)
|
||||
{
|
||||
@@ -5306,6 +5307,7 @@ optget(register char** argv, const char*
|
||||
opt_info.index++;
|
||||
if (*(s + 1) == '?' && (*opt_info.arg == '-' || (pass->flags & OPT_plus) && *opt_info.arg == '+') && *(opt_info.arg + 1))
|
||||
{
|
||||
+ opt_info.num = (long)(opt_info.number = 0);
|
||||
opt_info.index--;
|
||||
opt_info.arg = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user