sync with OpenBSD: remove unused code and vars; name clash with libc
compiles under MirBSD
This commit is contained in:
24
exec.c
24
exec.c
@ -1,8 +1,8 @@
|
||||
/* $OpenBSD: exec.c,v 1.42 2005/09/11 18:02:27 otto Exp $ */
|
||||
/* $OpenBSD: exec.c,v 1.44 2005/12/11 20:31:21 otto Exp $ */
|
||||
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.12 2005/11/22 18:40:41 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.13 2006/01/29 20:04:51 tg Exp $");
|
||||
|
||||
static int comexec(struct op *, struct tbl *volatile, char **,
|
||||
int volatile);
|
||||
@ -688,7 +688,7 @@ shcomexec(char **wp)
|
||||
{
|
||||
struct tbl *tp;
|
||||
|
||||
tp = tsearch(&builtins, *wp, hash(*wp));
|
||||
tp = ktsearch(&builtins, *wp, hash(*wp));
|
||||
if (tp == NULL)
|
||||
internal_errorf(1, "shcomexec: %s", *wp);
|
||||
return call_builtin(tp, wp);
|
||||
@ -705,11 +705,11 @@ findfunc(const char *name, unsigned int h, int create)
|
||||
struct tbl *tp = NULL;
|
||||
|
||||
for (l = e->loc; l; l = l->next) {
|
||||
tp = tsearch(&l->funs, name, h);
|
||||
tp = ktsearch(&l->funs, name, h);
|
||||
if (tp)
|
||||
break;
|
||||
if (!l->next && create) {
|
||||
tp = tenter(&l->funs, name, h);
|
||||
tp = ktenter(&l->funs, name, h);
|
||||
tp->flag = DEFINED;
|
||||
tp->type = CFUNC;
|
||||
tp->val.t = NULL;
|
||||
@ -751,7 +751,7 @@ define(const char *name, struct op *t)
|
||||
}
|
||||
|
||||
if (t == NULL) { /* undefine */
|
||||
tdelete(tp);
|
||||
ktdelete(tp);
|
||||
return was_set ? 0 : 1;
|
||||
}
|
||||
|
||||
@ -784,7 +784,7 @@ builtin(const char *name, int (*func) (char **))
|
||||
break;
|
||||
}
|
||||
|
||||
tp = tenter(&builtins, name, hash(name));
|
||||
tp = ktenter(&builtins, name, hash(name));
|
||||
tp->flag = DEFINED | flag;
|
||||
tp->type = CSHELL;
|
||||
tp->val.f = func;
|
||||
@ -810,7 +810,7 @@ findcom(const char *name, int flags)
|
||||
flags &= ~FC_FUNC;
|
||||
goto Search;
|
||||
}
|
||||
tbi = (flags & FC_BI) ? tsearch(&builtins, name, h) : NULL;
|
||||
tbi = (flags & FC_BI) ? ktsearch(&builtins, name, h) : NULL;
|
||||
/* POSIX says special builtins first, then functions, then
|
||||
* POSIX regular builtins, then search path...
|
||||
*/
|
||||
@ -832,7 +832,7 @@ findcom(const char *name, int flags)
|
||||
if (!tp && (flags & FC_UNREGBI) && tbi)
|
||||
tp = tbi;
|
||||
if (!tp && (flags & FC_PATH) && !(flags & FC_DEFPATH)) {
|
||||
tp = tsearch(&taliases, name, h);
|
||||
tp = ktsearch(&taliases, name, h);
|
||||
if (tp && (tp->flag & ISSET) && eaccess(tp->val.s, X_OK) != 0) {
|
||||
if (tp->flag & ALLOC) {
|
||||
tp->flag &= ~ALLOC;
|
||||
@ -847,7 +847,7 @@ findcom(const char *name, int flags)
|
||||
(flags & FC_PATH)) {
|
||||
if (!tp) {
|
||||
if (insert && !(flags & FC_DEFPATH)) {
|
||||
tp = tenter(&taliases, name, h);
|
||||
tp = ktenter(&taliases, name, h);
|
||||
tp->type = CTALIAS;
|
||||
} else {
|
||||
tp = &temp;
|
||||
@ -887,7 +887,7 @@ flushcom(int all) /* just relative or all */
|
||||
struct tbl *tp;
|
||||
struct tstate ts;
|
||||
|
||||
for (twalk(&ts, &taliases); (tp = tnext(&ts)) != NULL; )
|
||||
for (ktwalk(&ts, &taliases); (tp = ktnext(&ts)) != NULL; )
|
||||
if ((tp->flag&ISSET) && (all || tp->val.s[0] != '/')) {
|
||||
if (tp->flag&ALLOC) {
|
||||
tp->flag &= ~(ALLOC|ISSET);
|
||||
@ -1227,7 +1227,7 @@ struct select_menu_info {
|
||||
char *const *args;
|
||||
int arg_width;
|
||||
int num_width;
|
||||
} info;
|
||||
};
|
||||
|
||||
static char *select_fmt_entry(void *arg, int i, char *buf, int buflen);
|
||||
|
||||
|
Reference in New Issue
Block a user