improve string pooling: saves 316 bytes in .text
This commit is contained in:
parent
d09fd67299
commit
3747722db4
10
edit.c
10
edit.c
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.197 2010/08/28 16:47:08 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.198 2010/08/28 18:50:47 tg Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* in later versions we might use libtermcap for this, but since external
|
* in later versions we might use libtermcap for this, but since external
|
||||||
@ -324,7 +324,7 @@ x_file_glob(int flags MKSH_A_UNUSED, const char *str, int slen, char ***wordsp)
|
|||||||
source = s;
|
source = s;
|
||||||
if (yylex(ONEWORD | LQCHAR) != LWORD) {
|
if (yylex(ONEWORD | LQCHAR) != LWORD) {
|
||||||
source = sold;
|
source = sold;
|
||||||
internal_warningf("fileglob: substitute error");
|
internal_warningf("%s: %s", "fileglob", "substitute error");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
source = sold;
|
source = sold;
|
||||||
@ -2403,7 +2403,7 @@ x_bind(const char *a1, const char *a2,
|
|||||||
m1 = msg + strlen(msg);
|
m1 = msg + strlen(msg);
|
||||||
while (*c && m1 < (msg + sizeof(msg) - 3))
|
while (*c && m1 < (msg + sizeof(msg) - 3))
|
||||||
x_mapout2(*c++, &m1);
|
x_mapout2(*c++, &m1);
|
||||||
bi_errorf("%s' too long", msg);
|
bi_errorf("'%s' too long", msg);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
#ifndef MKSH_SMALL
|
#ifndef MKSH_SMALL
|
||||||
@ -2428,7 +2428,7 @@ x_bind(const char *a1, const char *a2,
|
|||||||
strcmp(x_ftab[f].xf_name, a2) == 0)
|
strcmp(x_ftab[f].xf_name, a2) == 0)
|
||||||
break;
|
break;
|
||||||
if (f == NELEM(x_ftab) || x_ftab[f].xf_flags & XF_NOBIND) {
|
if (f == NELEM(x_ftab) || x_ftab[f].xf_flags & XF_NOBIND) {
|
||||||
bi_errorf("%s: no such function", a2);
|
bi_errorf("%s: %s", a2, "no such function");
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4811,7 +4811,7 @@ grabhist(int save, int n)
|
|||||||
}
|
}
|
||||||
(void)histnum(n);
|
(void)histnum(n);
|
||||||
if ((hptr = *histpos()) == NULL) {
|
if ((hptr = *histpos()) == NULL) {
|
||||||
internal_warningf("grabhist: bad history array");
|
internal_warningf("%s: %s", "grabhist", "bad history array");
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
if (save)
|
if (save)
|
||||||
|
12
eval.c
12
eval.c
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.90 2010/07/17 22:09:33 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.91 2010/08/28 18:50:49 tg Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* string expansion
|
* string expansion
|
||||||
@ -334,7 +334,7 @@ expand(const char *cp, /* input word */
|
|||||||
*end = EOS;
|
*end = EOS;
|
||||||
str = snptreef(NULL, 64, "%S", beg);
|
str = snptreef(NULL, 64, "%S", beg);
|
||||||
afree(beg, ATEMP);
|
afree(beg, ATEMP);
|
||||||
errorf("%s: bad substitution", str);
|
errorf("%s: %s", str, "bad substitution");
|
||||||
}
|
}
|
||||||
if (f & DOBLANK)
|
if (f & DOBLANK)
|
||||||
doblank++;
|
doblank++;
|
||||||
@ -974,7 +974,7 @@ varsub(Expand *xp, const char *sp, const char *word,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Flag(FNOUNSET) && c == 0 && !zero_ok)
|
if (Flag(FNOUNSET) && c == 0 && !zero_ok)
|
||||||
errorf("%s: parameter not set", sp);
|
errorf("%s: %s", sp, "parameter not set");
|
||||||
*stypep = 0; /* unqualified variable/string substitution */
|
*stypep = 0; /* unqualified variable/string substitution */
|
||||||
xp->str = shf_smprintf("%d", c);
|
xp->str = shf_smprintf("%d", c);
|
||||||
return (XSUB);
|
return (XSUB);
|
||||||
@ -1105,7 +1105,7 @@ varsub(Expand *xp, const char *sp, const char *word,
|
|||||||
state = XBASE; /* expand word instead of variable value */
|
state = XBASE; /* expand word instead of variable value */
|
||||||
if (Flag(FNOUNSET) && xp->str == null && !zero_ok &&
|
if (Flag(FNOUNSET) && xp->str == null && !zero_ok &&
|
||||||
(ctype(c, C_SUBOP2) || (state != XBASE && c != '+')))
|
(ctype(c, C_SUBOP2) || (state != XBASE && c != '+')))
|
||||||
errorf("%s: parameter not set", sp);
|
errorf("%s: %s", sp, "parameter not set");
|
||||||
return (state);
|
return (state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1135,12 +1135,12 @@ comsub(Expand *xp, const char *cp)
|
|||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
if ((io->flag&IOTYPE) != IOREAD)
|
if ((io->flag&IOTYPE) != IOREAD)
|
||||||
errorf("funny $() command: %s",
|
errorf("%s: %s", "funny $() command",
|
||||||
snptreef(NULL, 32, "%R", io));
|
snptreef(NULL, 32, "%R", io));
|
||||||
shf = shf_open(name = evalstr(io->name, DOTILDE), O_RDONLY, 0,
|
shf = shf_open(name = evalstr(io->name, DOTILDE), O_RDONLY, 0,
|
||||||
SHF_MAPHI|SHF_CLEXEC);
|
SHF_MAPHI|SHF_CLEXEC);
|
||||||
if (shf == NULL)
|
if (shf == NULL)
|
||||||
errorf("%s: cannot open $() input", name);
|
errorf("%s: %s", name, "cannot open $() input");
|
||||||
xp->split = 0; /* no waitlast() */
|
xp->split = 0; /* no waitlast() */
|
||||||
} else {
|
} else {
|
||||||
int ofd1, pv[2];
|
int ofd1, pv[2];
|
||||||
|
43
exec.c
43
exec.c
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.78 2010/08/28 17:21:43 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.79 2010/08/28 18:50:49 tg Exp $");
|
||||||
|
|
||||||
#ifndef MKSH_DEFAULT_EXECSHELL
|
#ifndef MKSH_DEFAULT_EXECSHELL
|
||||||
#define MKSH_DEFAULT_EXECSHELL "/bin/sh"
|
#define MKSH_DEFAULT_EXECSHELL "/bin/sh"
|
||||||
@ -450,7 +450,7 @@ comexec(struct op *t, struct tbl *volatile tp, const char **ap,
|
|||||||
}
|
}
|
||||||
tp = findcom(cp, FC_BI);
|
tp = findcom(cp, FC_BI);
|
||||||
if (tp == NULL)
|
if (tp == NULL)
|
||||||
errorf("builtin: %s: not a builtin", cp);
|
errorf("%s: %s: %s", T_builtin, cp, "not a builtin");
|
||||||
continue;
|
continue;
|
||||||
} else if (tp->val.f == c_exec) {
|
} else if (tp->val.f == c_exec) {
|
||||||
if (ap[1] == NULL)
|
if (ap[1] == NULL)
|
||||||
@ -472,8 +472,8 @@ comexec(struct op *t, struct tbl *volatile tp, const char **ap,
|
|||||||
fcflags = FC_BI|FC_PATH;
|
fcflags = FC_BI|FC_PATH;
|
||||||
if (saw_p) {
|
if (saw_p) {
|
||||||
if (Flag(FRESTRICTED)) {
|
if (Flag(FRESTRICTED)) {
|
||||||
warningf(true,
|
warningf(true, "%s: %s",
|
||||||
"command -p: restricted");
|
"command -p", "restricted");
|
||||||
rv = 1;
|
rv = 1;
|
||||||
goto Leave;
|
goto Leave;
|
||||||
}
|
}
|
||||||
@ -551,7 +551,7 @@ comexec(struct op *t, struct tbl *volatile tp, const char **ap,
|
|||||||
goto Leave;
|
goto Leave;
|
||||||
} else if (!tp) {
|
} else if (!tp) {
|
||||||
if (Flag(FRESTRICTED) && vstrchr(cp, '/')) {
|
if (Flag(FRESTRICTED) && vstrchr(cp, '/')) {
|
||||||
warningf(true, "%s: restricted", cp);
|
warningf(true, "%s: %s", cp, "restricted");
|
||||||
rv = 1;
|
rv = 1;
|
||||||
goto Leave;
|
goto Leave;
|
||||||
}
|
}
|
||||||
@ -573,15 +573,13 @@ comexec(struct op *t, struct tbl *volatile tp, const char **ap,
|
|||||||
|
|
||||||
if (!tp->u.fpath) {
|
if (!tp->u.fpath) {
|
||||||
if (tp->u2.errno_) {
|
if (tp->u2.errno_) {
|
||||||
warningf(true,
|
warningf(true, "%s: %s: %s", cp,
|
||||||
"%s: can't find function "
|
"can't find function definition file",
|
||||||
"definition file - %s",
|
strerror(tp->u2.errno_));
|
||||||
cp, strerror(tp->u2.errno_));
|
|
||||||
rv = 126;
|
rv = 126;
|
||||||
} else {
|
} else {
|
||||||
warningf(true,
|
warningf(true, "%s: %s", cp,
|
||||||
"%s: can't find function "
|
"can't find function definition file");
|
||||||
"definition file", cp);
|
|
||||||
rv = 127;
|
rv = 127;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -589,16 +587,15 @@ comexec(struct op *t, struct tbl *volatile tp, const char **ap,
|
|||||||
if (include(tp->u.fpath, 0, NULL, 0) < 0) {
|
if (include(tp->u.fpath, 0, NULL, 0) < 0) {
|
||||||
rv = errno;
|
rv = errno;
|
||||||
warningf(true,
|
warningf(true,
|
||||||
"%s: can't open function definition file %s - %s",
|
"%s: can't open function definition file %s: %s",
|
||||||
cp, tp->u.fpath, strerror(rv));
|
cp, tp->u.fpath, strerror(rv));
|
||||||
rv = 127;
|
rv = 127;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!(ftp = findfunc(cp, hash(cp), false)) ||
|
if (!(ftp = findfunc(cp, hash(cp), false)) ||
|
||||||
!(ftp->flag & ISSET)) {
|
!(ftp->flag & ISSET)) {
|
||||||
warningf(true,
|
warningf(true, "%s: %s %s", cp,
|
||||||
"%s: function not defined by %s",
|
"function not defined by", tp->u.fpath);
|
||||||
cp, tp->u.fpath);
|
|
||||||
rv = 127;
|
rv = 127;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -681,11 +678,11 @@ comexec(struct op *t, struct tbl *volatile tp, const char **ap,
|
|||||||
* useful error message and set the exit status to 126.
|
* useful error message and set the exit status to 126.
|
||||||
*/
|
*/
|
||||||
if (tp->u2.errno_) {
|
if (tp->u2.errno_) {
|
||||||
warningf(true, "%s: cannot execute - %s", cp,
|
warningf(true, "%s: %s: %s", cp,
|
||||||
strerror(tp->u2.errno_));
|
"cannot execute", strerror(tp->u2.errno_));
|
||||||
rv = 126; /* POSIX */
|
rv = 126; /* POSIX */
|
||||||
} else {
|
} else {
|
||||||
warningf(true, "%s: not found", cp);
|
warningf(true, "%s: %s", cp, "not found");
|
||||||
rv = 127;
|
rv = 127;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -822,7 +819,7 @@ shcomexec(const char **wp)
|
|||||||
|
|
||||||
tp = ktsearch(&builtins, *wp, hash(*wp));
|
tp = ktsearch(&builtins, *wp, hash(*wp));
|
||||||
if (tp == NULL)
|
if (tp == NULL)
|
||||||
internal_errorf("shcomexec: %s", *wp);
|
internal_errorf("%s: %s", "shcomexec", *wp);
|
||||||
return (call_builtin(tp, wp));
|
return (call_builtin(tp, wp));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1198,7 +1195,7 @@ iosetup(struct ioword *iop, struct tbl *tp)
|
|||||||
|
|
||||||
if (do_open) {
|
if (do_open) {
|
||||||
if (Flag(FRESTRICTED) && (flags & O_CREAT)) {
|
if (Flag(FRESTRICTED) && (flags & O_CREAT)) {
|
||||||
warningf(true, "%s: restricted", cp);
|
warningf(true, "%s: %s", cp, "restricted");
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
u = open(cp, flags, 0666);
|
u = open(cp, flags, 0666);
|
||||||
@ -1237,7 +1234,7 @@ iosetup(struct ioword *iop, struct tbl *tp)
|
|||||||
|
|
||||||
ev = errno;
|
ev = errno;
|
||||||
warningf(true,
|
warningf(true,
|
||||||
"could not finish (dup) redirection %s: %s",
|
"%s %s %s", "could not finish (dup) redirection",
|
||||||
snptreef(NULL, 32, "%R", &iotmp),
|
snptreef(NULL, 32, "%R", &iotmp),
|
||||||
strerror(ev));
|
strerror(ev));
|
||||||
if (iotype != IODUP)
|
if (iotype != IODUP)
|
||||||
@ -1309,7 +1306,7 @@ herein(const char *content, int sub)
|
|||||||
s->start = s->str = content;
|
s->start = s->str = content;
|
||||||
source = s;
|
source = s;
|
||||||
if (yylex(ONEWORD|HEREDOC) != LWORD)
|
if (yylex(ONEWORD|HEREDOC) != LWORD)
|
||||||
internal_errorf("herein: yylex");
|
internal_errorf("%s: %s", "herein", "yylex");
|
||||||
source = osource;
|
source = osource;
|
||||||
shf_puts(evalstr(yylval.cp, 0), shf);
|
shf_puts(evalstr(yylval.cp, 0), shf);
|
||||||
} else
|
} else
|
||||||
|
20
expr.c
20
expr.c
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.44 2010/08/14 21:35:13 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.45 2010/08/28 18:50:50 tg Exp $");
|
||||||
|
|
||||||
/* The order of these enums is constrained by the order of opinfo[] */
|
/* The order of these enums is constrained by the order of opinfo[] */
|
||||||
enum token {
|
enum token {
|
||||||
@ -269,26 +269,28 @@ evalerr(Expr_state *es, enum error_type type, const char *str)
|
|||||||
default:
|
default:
|
||||||
s = opinfo[(int)es->tok].name;
|
s = opinfo[(int)es->tok].name;
|
||||||
}
|
}
|
||||||
warningf(true, "%s: unexpected '%s'", es->expression, s);
|
warningf(true, "%s: %s '%s'", es->expression,
|
||||||
|
"unexpected", s);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ET_BADLIT:
|
case ET_BADLIT:
|
||||||
warningf(true, "%s: bad number '%s'", es->expression, str);
|
warningf(true, "%s: %s '%s'", es->expression,
|
||||||
|
"bad number", str);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ET_RECURSIVE:
|
case ET_RECURSIVE:
|
||||||
warningf(true, "%s: expression recurses on parameter '%s'",
|
warningf(true, "%s: %s '%s'", es->expression,
|
||||||
es->expression, str);
|
"expression recurses on parameter", str);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ET_LVALUE:
|
case ET_LVALUE:
|
||||||
warningf(true, "%s: %s requires lvalue",
|
warningf(true, "%s: %s %s",
|
||||||
es->expression, str);
|
es->expression, str, "requires lvalue");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ET_RDONLY:
|
case ET_RDONLY:
|
||||||
warningf(true, "%s: %s applied to read only variable",
|
warningf(true, "%s: %s %s",
|
||||||
es->expression, str);
|
es->expression, str, "applied to read only variable");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: /* keep gcc happy */
|
default: /* keep gcc happy */
|
||||||
|
139
funcs.c
139
funcs.c
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.158 2010/08/28 17:21:44 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.159 2010/08/28 18:50:51 tg Exp $");
|
||||||
|
|
||||||
#if HAVE_KILLPG
|
#if HAVE_KILLPG
|
||||||
/*
|
/*
|
||||||
@ -59,14 +59,14 @@ const struct builtin mkshbuiltins[] = {
|
|||||||
{"*=:", c_label},
|
{"*=:", c_label},
|
||||||
{"[", c_test},
|
{"[", c_test},
|
||||||
{"*=break", c_brkcont},
|
{"*=break", c_brkcont},
|
||||||
{"=builtin", c_builtin},
|
{T_gbuiltin, c_builtin},
|
||||||
{"*=continue", c_brkcont},
|
{"*=continue", c_brkcont},
|
||||||
{"*=eval", c_eval},
|
{"*=eval", c_eval},
|
||||||
{"*=exec", c_exec},
|
{"*=exec", c_exec},
|
||||||
{"*=exit", c_exitreturn},
|
{"*=exit", c_exitreturn},
|
||||||
{"+false", c_label},
|
{"+false", c_label},
|
||||||
{"*=return", c_exitreturn},
|
{"*=return", c_exitreturn},
|
||||||
{"*=set", c_set},
|
{T_sgset, c_set},
|
||||||
{"*=shift", c_shift},
|
{"*=shift", c_shift},
|
||||||
{"=times", c_times},
|
{"=times", c_times},
|
||||||
{"*=trap", c_trap},
|
{"*=trap", c_trap},
|
||||||
@ -77,7 +77,7 @@ const struct builtin mkshbuiltins[] = {
|
|||||||
{"ulimit", c_ulimit},
|
{"ulimit", c_ulimit},
|
||||||
{"+umask", c_umask},
|
{"+umask", c_umask},
|
||||||
{"*=unset", c_unset},
|
{"*=unset", c_unset},
|
||||||
{"+alias", c_alias}, /* no =: AT&T manual wrong */
|
{T_palias, c_alias}, /* no =: AT&T manual wrong */
|
||||||
{"+cd", c_cd},
|
{"+cd", c_cd},
|
||||||
{"chdir", c_cd}, /* dash compatibility hack */
|
{"chdir", c_cd}, /* dash compatibility hack */
|
||||||
{"+command", c_command},
|
{"+command", c_command},
|
||||||
@ -95,7 +95,7 @@ const struct builtin mkshbuiltins[] = {
|
|||||||
{"pwd", c_pwd},
|
{"pwd", c_pwd},
|
||||||
{"*=readonly", c_typeset},
|
{"*=readonly", c_typeset},
|
||||||
{T__typeset, c_typeset},
|
{T__typeset, c_typeset},
|
||||||
{"+unalias", c_unalias},
|
{T_punalias, c_unalias},
|
||||||
{"whence", c_whence},
|
{"whence", c_whence},
|
||||||
#ifndef MKSH_UNEMPLOYED
|
#ifndef MKSH_UNEMPLOYED
|
||||||
{"+bg", c_fgbg},
|
{"+bg", c_fgbg},
|
||||||
@ -447,9 +447,9 @@ c_cd(const char **wp)
|
|||||||
|
|
||||||
if (rv < 0) {
|
if (rv < 0) {
|
||||||
if (cdnode)
|
if (cdnode)
|
||||||
bi_errorf("%s: bad directory", dir);
|
bi_errorf("%s: %s", dir, "bad directory");
|
||||||
else
|
else
|
||||||
bi_errorf("%s - %s", tryp, strerror(errno));
|
bi_errorf("%s: %s", tryp, strerror(errno));
|
||||||
afree(allocd, ATEMP);
|
afree(allocd, ATEMP);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
@ -521,7 +521,7 @@ c_pwd(const char **wp)
|
|||||||
if (p && access(p, R_OK) < 0)
|
if (p && access(p, R_OK) < 0)
|
||||||
p = NULL;
|
p = NULL;
|
||||||
if (!p && !(p = allocd = ksh_get_wd(NULL))) {
|
if (!p && !(p = allocd = ksh_get_wd(NULL))) {
|
||||||
bi_errorf("can't get current directory - %s", strerror(errno));
|
bi_errorf("%s: %s", "can't get current directory", strerror(errno));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
shprintf("%s\n", p);
|
shprintf("%s\n", p);
|
||||||
@ -613,7 +613,7 @@ c_print(const char **wp)
|
|||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
if ((fd = coproc_getfd(W_OK, &emsg)) < 0) {
|
if ((fd = coproc_getfd(W_OK, &emsg)) < 0) {
|
||||||
bi_errorf("-p: %s", emsg);
|
bi_errorf("%s: %s", "-p", emsg);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -627,7 +627,7 @@ c_print(const char **wp)
|
|||||||
if (!*(s = builtin_opt.optarg))
|
if (!*(s = builtin_opt.optarg))
|
||||||
fd = 0;
|
fd = 0;
|
||||||
else if ((fd = check_fd(s, W_OK, &emsg)) < 0) {
|
else if ((fd = check_fd(s, W_OK, &emsg)) < 0) {
|
||||||
bi_errorf("-u: %s: %s", s, emsg);
|
bi_errorf("%s: %s: %s", "-u", s, emsg);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -796,22 +796,32 @@ c_whence(const char **wp)
|
|||||||
if (vflag || (tp->type != CALIAS && tp->type != CEXEC &&
|
if (vflag || (tp->type != CALIAS && tp->type != CEXEC &&
|
||||||
tp->type != CTALIAS))
|
tp->type != CTALIAS))
|
||||||
shf_puts(id, shl_stdout);
|
shf_puts(id, shl_stdout);
|
||||||
|
if (vflag)
|
||||||
|
switch (tp->type) {
|
||||||
|
case CKEYWD:
|
||||||
|
case CALIAS:
|
||||||
|
case CFUNC:
|
||||||
|
case CSHELL:
|
||||||
|
shf_puts(" is a", shl_stdout);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch (tp->type) {
|
switch (tp->type) {
|
||||||
case CKEYWD:
|
case CKEYWD:
|
||||||
if (vflag)
|
if (vflag)
|
||||||
shf_puts(" is a reserved word", shl_stdout);
|
shf_puts(" reserved word", shl_stdout);
|
||||||
break;
|
break;
|
||||||
case CALIAS:
|
case CALIAS:
|
||||||
if (vflag)
|
if (vflag)
|
||||||
shprintf(" is an %salias for ",
|
shprintf("n %s%s for ",
|
||||||
(tp->flag & EXPORT) ? "exported " : null);
|
(tp->flag & EXPORT) ? "exported " : null,
|
||||||
|
T_alias);
|
||||||
if (!iam_whence && !vflag)
|
if (!iam_whence && !vflag)
|
||||||
shprintf("alias %s=", id);
|
shprintf("%s %s=", T_alias, id);
|
||||||
print_value_quoted(tp->val.s);
|
print_value_quoted(tp->val.s);
|
||||||
break;
|
break;
|
||||||
case CFUNC:
|
case CFUNC:
|
||||||
if (vflag) {
|
if (vflag) {
|
||||||
shf_puts(" is a", shl_stdout);
|
|
||||||
if (tp->flag & EXPORT)
|
if (tp->flag & EXPORT)
|
||||||
shf_puts("n exported", shl_stdout);
|
shf_puts("n exported", shl_stdout);
|
||||||
if (tp->flag & TRACE)
|
if (tp->flag & TRACE)
|
||||||
@ -827,8 +837,9 @@ c_whence(const char **wp)
|
|||||||
break;
|
break;
|
||||||
case CSHELL:
|
case CSHELL:
|
||||||
if (vflag)
|
if (vflag)
|
||||||
shprintf(" is a%s shell builtin",
|
shprintf("%s %s %s",
|
||||||
(tp->flag & SPEC_BI) ? " special" : null);
|
(tp->flag & SPEC_BI) ? " special" : null,
|
||||||
|
"shell", T_builtin);
|
||||||
break;
|
break;
|
||||||
case CTALIAS:
|
case CTALIAS:
|
||||||
case CEXEC:
|
case CEXEC:
|
||||||
@ -836,14 +847,15 @@ c_whence(const char **wp)
|
|||||||
if (vflag) {
|
if (vflag) {
|
||||||
shf_puts(" is ", shl_stdout);
|
shf_puts(" is ", shl_stdout);
|
||||||
if (tp->type == CTALIAS)
|
if (tp->type == CTALIAS)
|
||||||
shprintf("a tracked %salias for ",
|
shprintf("a tracked %s%s for ",
|
||||||
(tp->flag & EXPORT) ?
|
(tp->flag & EXPORT) ?
|
||||||
"exported " : null);
|
"exported " : null,
|
||||||
|
T_alias);
|
||||||
}
|
}
|
||||||
shf_puts(tp->val.s, shl_stdout);
|
shf_puts(tp->val.s, shl_stdout);
|
||||||
} else {
|
} else {
|
||||||
if (vflag)
|
if (vflag)
|
||||||
shf_puts(" not found", shl_stdout);
|
shprintf(" %s\n", "not found");
|
||||||
rv = 1;
|
rv = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1051,7 +1063,7 @@ c_typeset(const char **wp)
|
|||||||
"function %s %T\n" :
|
"function %s %T\n" :
|
||||||
"%s() %T\n", wp[i], f->val.t);
|
"%s() %T\n", wp[i], f->val.t);
|
||||||
} else if (!typeset(wp[i], fset, fclr, field, base)) {
|
} else if (!typeset(wp[i], fset, fclr, field, base)) {
|
||||||
bi_errorf("%s: not identifier", wp[i]);
|
bi_errorf("%s: %s", wp[i], "not identifier");
|
||||||
set_refflag = 0;
|
set_refflag = 0;
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
@ -1120,27 +1132,27 @@ c_typeset(const char **wp)
|
|||||||
*/
|
*/
|
||||||
shf_puts("typeset ", shl_stdout);
|
shf_puts("typeset ", shl_stdout);
|
||||||
if (((vp->flag&(ARRAY|ASSOC))==ASSOC))
|
if (((vp->flag&(ARRAY|ASSOC))==ASSOC))
|
||||||
shf_puts("-n ", shl_stdout);
|
shprintf("%s ", "-n");
|
||||||
if ((vp->flag&INTEGER))
|
if ((vp->flag&INTEGER))
|
||||||
shf_puts("-i ", shl_stdout);
|
shprintf("%s ", "-i");
|
||||||
if ((vp->flag&EXPORT))
|
if ((vp->flag&EXPORT))
|
||||||
shf_puts("-x ", shl_stdout);
|
shprintf("%s ", "-x");
|
||||||
if ((vp->flag&RDONLY))
|
if ((vp->flag&RDONLY))
|
||||||
shf_puts("-r ", shl_stdout);
|
shprintf("%s ", "-r");
|
||||||
if ((vp->flag&TRACE))
|
if ((vp->flag&TRACE))
|
||||||
shf_puts("-t ", shl_stdout);
|
shprintf("%s ", "-t");
|
||||||
if ((vp->flag&LJUST))
|
if ((vp->flag&LJUST))
|
||||||
shprintf("-L%d ", vp->u2.field);
|
shprintf("-L%d ", vp->u2.field);
|
||||||
if ((vp->flag&RJUST))
|
if ((vp->flag&RJUST))
|
||||||
shprintf("-R%d ", vp->u2.field);
|
shprintf("-R%d ", vp->u2.field);
|
||||||
if ((vp->flag&ZEROFIL))
|
if ((vp->flag&ZEROFIL))
|
||||||
shf_puts("-Z ", shl_stdout);
|
shprintf("%s ", "-Z");
|
||||||
if ((vp->flag&LCASEV))
|
if ((vp->flag&LCASEV))
|
||||||
shf_puts("-l ", shl_stdout);
|
shprintf("%s ", "-l");
|
||||||
if ((vp->flag&UCASEV_AL))
|
if ((vp->flag&UCASEV_AL))
|
||||||
shf_puts("-u ", shl_stdout);
|
shprintf("%s ", "-u");
|
||||||
if ((vp->flag&INT_U))
|
if ((vp->flag&INT_U))
|
||||||
shf_puts("-U ", shl_stdout);
|
shprintf("%s ", "-U");
|
||||||
shf_puts(vp->name, shl_stdout);
|
shf_puts(vp->name, shl_stdout);
|
||||||
if (pflag) {
|
if (pflag) {
|
||||||
char *s = str_val(vp);
|
char *s = str_val(vp);
|
||||||
@ -1259,12 +1271,12 @@ c_alias(const char **wp)
|
|||||||
/* "hash -r" means reset all the tracked aliases.. */
|
/* "hash -r" means reset all the tracked aliases.. */
|
||||||
if (rflag) {
|
if (rflag) {
|
||||||
static const char *args[] = {
|
static const char *args[] = {
|
||||||
"unalias", "-ta", NULL
|
T_unalias, "-ta", NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!tflag || *wp) {
|
if (!tflag || *wp) {
|
||||||
shf_puts("alias: -r flag can only be used with -t"
|
shprintf("%s: -r flag can only be used with -t"
|
||||||
" and without arguments\n", shl_stdout);
|
" and without arguments\n", T_alias);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
ksh_getopt_reset(&builtin_opt, GF_ERROR);
|
ksh_getopt_reset(&builtin_opt, GF_ERROR);
|
||||||
@ -1277,7 +1289,7 @@ c_alias(const char **wp)
|
|||||||
for (p = ktsort(t); (ap = *p++) != NULL; )
|
for (p = ktsort(t); (ap = *p++) != NULL; )
|
||||||
if ((ap->flag & (ISSET|xflag)) == (ISSET|xflag)) {
|
if ((ap->flag & (ISSET|xflag)) == (ISSET|xflag)) {
|
||||||
if (pflag)
|
if (pflag)
|
||||||
shf_puts("alias ", shl_stdout);
|
shprintf("%s ", T_alias);
|
||||||
shf_puts(ap->name, shl_stdout);
|
shf_puts(ap->name, shl_stdout);
|
||||||
if (prefix != '+') {
|
if (prefix != '+') {
|
||||||
shf_putc('=', shl_stdout);
|
shf_putc('=', shl_stdout);
|
||||||
@ -1302,7 +1314,7 @@ c_alias(const char **wp)
|
|||||||
ap = ktsearch(t, alias, h);
|
ap = ktsearch(t, alias, h);
|
||||||
if (ap != NULL && (ap->flag&ISSET)) {
|
if (ap != NULL && (ap->flag&ISSET)) {
|
||||||
if (pflag)
|
if (pflag)
|
||||||
shf_puts("alias ", shl_stdout);
|
shprintf("%s ", T_alias);
|
||||||
shf_puts(ap->name, shl_stdout);
|
shf_puts(ap->name, shl_stdout);
|
||||||
if (prefix != '+') {
|
if (prefix != '+') {
|
||||||
shf_putc('=', shl_stdout);
|
shf_putc('=', shl_stdout);
|
||||||
@ -1310,7 +1322,8 @@ c_alias(const char **wp)
|
|||||||
}
|
}
|
||||||
shf_putc('\n', shl_stdout);
|
shf_putc('\n', shl_stdout);
|
||||||
} else {
|
} else {
|
||||||
shprintf("%s alias not found\n", alias);
|
shprintf("%s %s %s\n", alias, T_alias,
|
||||||
|
"not found");
|
||||||
rv = 1;
|
rv = 1;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@ -1583,8 +1596,8 @@ c_kill(const char **wp)
|
|||||||
if (j_kill(p, sig))
|
if (j_kill(p, sig))
|
||||||
rv = 1;
|
rv = 1;
|
||||||
} else if (!getn(p, &n)) {
|
} else if (!getn(p, &n)) {
|
||||||
bi_errorf("%s: arguments must be jobs or process IDs",
|
bi_errorf("%s: %s", p,
|
||||||
p);
|
"arguments must be jobs or process IDs");
|
||||||
rv = 1;
|
rv = 1;
|
||||||
} else {
|
} else {
|
||||||
if (mksh_kill(n, sig) < 0) {
|
if (mksh_kill(n, sig) < 0) {
|
||||||
@ -1619,22 +1632,22 @@ c_getopts(const char **wp)
|
|||||||
|
|
||||||
opts = *wp++;
|
opts = *wp++;
|
||||||
if (!opts) {
|
if (!opts) {
|
||||||
bi_errorf("missing options argument");
|
bi_errorf("missing %s argument", "options");
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
var = *wp++;
|
var = *wp++;
|
||||||
if (!var) {
|
if (!var) {
|
||||||
bi_errorf("missing name argument");
|
bi_errorf("missing %s argument", "name");
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
if (!*var || *skip_varname(var, true)) {
|
if (!*var || *skip_varname(var, true)) {
|
||||||
bi_errorf("%s: is not an identifier", var);
|
bi_errorf("%s: %s", var, "is not an identifier");
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e->loc->next == NULL) {
|
if (e->loc->next == NULL) {
|
||||||
internal_warningf("c_getopts: no argv");
|
internal_warningf("%s: %s", "c_getopts", "no argv");
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
/* Which arguments are we parsing... */
|
/* Which arguments are we parsing... */
|
||||||
@ -1777,7 +1790,7 @@ c_shift(const char **wp)
|
|||||||
} else
|
} else
|
||||||
n = 1;
|
n = 1;
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
bi_errorf("%s: bad number", arg);
|
bi_errorf("%s: %s", arg, "bad number");
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
if (l->argc < n) {
|
if (l->argc < n) {
|
||||||
@ -1995,7 +2008,7 @@ c_read(const char **wp)
|
|||||||
switch (optc) {
|
switch (optc) {
|
||||||
case 'p':
|
case 'p':
|
||||||
if ((fd = coproc_getfd(R_OK, &emsg)) < 0) {
|
if ((fd = coproc_getfd(R_OK, &emsg)) < 0) {
|
||||||
bi_errorf("-p: %s", emsg);
|
bi_errorf("%s: %s", "-p", emsg);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2009,7 +2022,7 @@ c_read(const char **wp)
|
|||||||
if (!*(cp = builtin_opt.optarg))
|
if (!*(cp = builtin_opt.optarg))
|
||||||
fd = 0;
|
fd = 0;
|
||||||
else if ((fd = check_fd(cp, R_OK, &emsg)) < 0) {
|
else if ((fd = check_fd(cp, R_OK, &emsg)) < 0) {
|
||||||
bi_errorf("-u: %s: %s", cp, emsg);
|
bi_errorf("%s: %s: %s", "-u", cp, emsg);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2240,7 +2253,7 @@ c_trap(const char **wp)
|
|||||||
while (*wp != NULL) {
|
while (*wp != NULL) {
|
||||||
p = gettrap(*wp++, true);
|
p = gettrap(*wp++, true);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
bi_errorf("bad signal %s", wp[-1]);
|
bi_errorf("bad signal '%s'", wp[-1]);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
settrap(p, s);
|
settrap(p, s);
|
||||||
@ -2261,7 +2274,7 @@ c_exitreturn(const char **wp)
|
|||||||
if (arg) {
|
if (arg) {
|
||||||
if (!getn(arg, &n)) {
|
if (!getn(arg, &n)) {
|
||||||
exstat = 1;
|
exstat = 1;
|
||||||
warningf(true, "%s: bad number", arg);
|
warningf(true, "%s: %s", arg, "bad number");
|
||||||
} else
|
} else
|
||||||
exstat = n;
|
exstat = n;
|
||||||
}
|
}
|
||||||
@ -2306,7 +2319,7 @@ c_brkcont(const char **wp)
|
|||||||
quit = n;
|
quit = n;
|
||||||
if (quit <= 0) {
|
if (quit <= 0) {
|
||||||
/* AT&T ksh does this for non-interactive shells only - weird */
|
/* AT&T ksh does this for non-interactive shells only - weird */
|
||||||
bi_errorf("%s: bad value", arg);
|
bi_errorf("%s: %s", arg, "bad value");
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2325,7 +2338,7 @@ c_brkcont(const char **wp)
|
|||||||
* scripts, but don't generate an error (ie, keep going).
|
* scripts, but don't generate an error (ie, keep going).
|
||||||
*/
|
*/
|
||||||
if (n == quit) {
|
if (n == quit) {
|
||||||
warningf(true, "%s: cannot %s", wp[0], wp[0]);
|
warningf(true, "%s: %s %s", wp[0], "cannot", wp[0]);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
/* POSIX says if n is too big, the last enclosing loop
|
/* POSIX says if n is too big, the last enclosing loop
|
||||||
@ -2351,7 +2364,7 @@ c_set(const char **wp)
|
|||||||
const char **owp;
|
const char **owp;
|
||||||
|
|
||||||
if (wp[1] == NULL) {
|
if (wp[1] == NULL) {
|
||||||
static const char *args[] = { "set", "-", NULL };
|
static const char *args[] = { T_set, "-", NULL };
|
||||||
return (c_typeset(args));
|
return (c_typeset(args));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2550,10 +2563,11 @@ timex_hook(struct op *t, char **volatile *app)
|
|||||||
t->str[0] |= TF_POSIX;
|
t->str[0] |= TF_POSIX;
|
||||||
break;
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
errorf("time: -%s unknown option", opt.optarg);
|
errorf("time: -%s %s", opt.optarg,
|
||||||
|
"unknown option");
|
||||||
case ':':
|
case ':':
|
||||||
errorf("time: -%s requires an argument",
|
errorf("time: -%s %s", opt.optarg,
|
||||||
opt.optarg);
|
"requires an argument");
|
||||||
}
|
}
|
||||||
/* Copy command words down over options. */
|
/* Copy command words down over options. */
|
||||||
if (opt.optind != 0) {
|
if (opt.optind != 0) {
|
||||||
@ -2641,21 +2655,21 @@ c_mknod(const char **wp)
|
|||||||
|
|
||||||
majnum = strtoul(argv[2], &c, 0);
|
majnum = strtoul(argv[2], &c, 0);
|
||||||
if ((c == argv[2]) || (*c != '\0')) {
|
if ((c == argv[2]) || (*c != '\0')) {
|
||||||
bi_errorf("non-numeric device major '%s'", argv[2]);
|
bi_errorf("non-numeric %s %s '%s'", "device", "major", argv[2]);
|
||||||
goto c_mknod_err;
|
goto c_mknod_err;
|
||||||
}
|
}
|
||||||
minnum = strtoul(argv[3], &c, 0);
|
minnum = strtoul(argv[3], &c, 0);
|
||||||
if ((c == argv[3]) || (*c != '\0')) {
|
if ((c == argv[3]) || (*c != '\0')) {
|
||||||
bi_errorf("non-numeric device minor '%s'", argv[3]);
|
bi_errorf("non-numeric %s %s '%s'", "device", "minor", argv[3]);
|
||||||
goto c_mknod_err;
|
goto c_mknod_err;
|
||||||
}
|
}
|
||||||
dv = makedev(majnum, minnum);
|
dv = makedev(majnum, minnum);
|
||||||
if ((unsigned long)(major(dv)) != majnum) {
|
if ((unsigned long)(major(dv)) != majnum) {
|
||||||
bi_errorf("device major too large: %lu", majnum);
|
bi_errorf("%s %s too large: %lu", "device", "major", majnum);
|
||||||
goto c_mknod_err;
|
goto c_mknod_err;
|
||||||
}
|
}
|
||||||
if ((unsigned long)(minor(dv)) != minnum) {
|
if ((unsigned long)(minor(dv)) != minnum) {
|
||||||
bi_errorf("device minor too large: %lu", minnum);
|
bi_errorf("%s %s too large: %lu", "device", "minor", minnum);
|
||||||
goto c_mknod_err;
|
goto c_mknod_err;
|
||||||
}
|
}
|
||||||
if (mknod(argv[0], mode, dv))
|
if (mknod(argv[0], mode, dv))
|
||||||
@ -2671,8 +2685,8 @@ c_mknod(const char **wp)
|
|||||||
umask(oldmode);
|
umask(oldmode);
|
||||||
return (rv);
|
return (rv);
|
||||||
c_mknod_usage:
|
c_mknod_usage:
|
||||||
bi_errorf("usage: mknod [-m mode] name b|c major minor");
|
bi_errorf("%s: %s", "usage", "mknod [-m mode] name b|c major minor");
|
||||||
bi_errorf("usage: mknod [-m mode] name p");
|
bi_errorf("%s: %s", "usage", "mknod [-m mode] name p");
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -3021,7 +3035,7 @@ test_primary(Test_env *te, bool do_eval)
|
|||||||
if (te->flags & TEF_ERROR)
|
if (te->flags & TEF_ERROR)
|
||||||
return (0);
|
return (0);
|
||||||
if (!(*te->isa)(te, TM_CPAREN)) {
|
if (!(*te->isa)(te, TM_CPAREN)) {
|
||||||
(*te->error)(te, 0, "missing closing paren");
|
(*te->error)(te, 0, "missing )");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
return (rv);
|
return (rv);
|
||||||
@ -3281,7 +3295,8 @@ c_ulimit(const char **wp)
|
|||||||
all = true;
|
all = true;
|
||||||
break;
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
bi_errorf("usage: ulimit [-acdfHLlmnpSsTtvw] [value]");
|
bi_errorf("%s: %s", "usage",
|
||||||
|
"ulimit [-acdfHLlmnpSsTtvw] [value]");
|
||||||
return (1);
|
return (1);
|
||||||
default:
|
default:
|
||||||
what = optc;
|
what = optc;
|
||||||
@ -3388,7 +3403,7 @@ c_rename(const char **wp)
|
|||||||
bi_errorf(T_synerr);
|
bi_errorf(T_synerr);
|
||||||
else if ((rv = rename(wp[1], wp[2])) != 0) {
|
else if ((rv = rename(wp[1], wp[2])) != 0) {
|
||||||
rv = errno;
|
rv = errno;
|
||||||
bi_errorf("failed: %s", strerror(rv));
|
bi_errorf("%s: %s", "failed", strerror(rv));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (rv);
|
return (rv);
|
||||||
|
24
histrap.c
24
histrap.c
@ -26,7 +26,7 @@
|
|||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.99 2010/08/28 15:48:18 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.100 2010/08/28 18:50:52 tg Exp $");
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* MirOS: This is the default mapping type, and need not be specified.
|
* MirOS: This is the default mapping type, and need not be specified.
|
||||||
@ -230,15 +230,16 @@ c_fc(const char **wp)
|
|||||||
|
|
||||||
tf = maketemp(ATEMP, TT_HIST_EDIT, &e->temps);
|
tf = maketemp(ATEMP, TT_HIST_EDIT, &e->temps);
|
||||||
if (!(shf = tf->shf)) {
|
if (!(shf = tf->shf)) {
|
||||||
bi_errorf("cannot create temp file %s - %s",
|
bi_errorf("can't %s temporary file %s: %s",
|
||||||
tf->name, strerror(errno));
|
"create", tf->name, strerror(errno));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
for (hp = rflag ? hlast : hfirst;
|
for (hp = rflag ? hlast : hfirst;
|
||||||
hp >= hfirst && hp <= hlast; hp += rflag ? -1 : 1)
|
hp >= hfirst && hp <= hlast; hp += rflag ? -1 : 1)
|
||||||
shf_fprintf(shf, "%s\n", *hp);
|
shf_fprintf(shf, "%s\n", *hp);
|
||||||
if (shf_close(shf) == EOF) {
|
if (shf_close(shf) == EOF) {
|
||||||
bi_errorf("error writing temporary file - %s", strerror(errno));
|
bi_errorf("can't %s temporary file %s: %s",
|
||||||
|
"write", tf->name, strerror(errno));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +264,8 @@ c_fc(const char **wp)
|
|||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (!(shf = shf_open(tf->name, O_RDONLY, 0, 0))) {
|
if (!(shf = shf_open(tf->name, O_RDONLY, 0, 0))) {
|
||||||
bi_errorf("cannot open temp file %s", tf->name);
|
bi_errorf("can't %s temporary file %s: %s",
|
||||||
|
"open", tf->name, strerror(errno));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,8 +277,8 @@ c_fc(const char **wp)
|
|||||||
XcheckN(xs, xp, Xlength(xs, xp));
|
XcheckN(xs, xp, Xlength(xs, xp));
|
||||||
}
|
}
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
bi_errorf("error reading temp file %s - %s",
|
bi_errorf("can't %s temporary file %s: %s",
|
||||||
tf->name, strerror(shf_errno(shf)));
|
"read", tf->name, strerror(shf_errno(shf)));
|
||||||
shf_close(shf);
|
shf_close(shf);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
@ -380,18 +382,18 @@ hist_get(const char *str, bool approx, bool allow_cur)
|
|||||||
if (approx)
|
if (approx)
|
||||||
hp = hist_get_oldest();
|
hp = hist_get_oldest();
|
||||||
else {
|
else {
|
||||||
bi_errorf("%s: not in history", str);
|
bi_errorf("%s: %s", str, "not in history");
|
||||||
hp = NULL;
|
hp = NULL;
|
||||||
}
|
}
|
||||||
} else if ((ptrdiff_t)hp > (ptrdiff_t)histptr) {
|
} else if ((ptrdiff_t)hp > (ptrdiff_t)histptr) {
|
||||||
if (approx)
|
if (approx)
|
||||||
hp = hist_get_newest(allow_cur);
|
hp = hist_get_newest(allow_cur);
|
||||||
else {
|
else {
|
||||||
bi_errorf("%s: not in history", str);
|
bi_errorf("%s: %s", str, "not in history");
|
||||||
hp = NULL;
|
hp = NULL;
|
||||||
}
|
}
|
||||||
} else if (!allow_cur && hp == histptr) {
|
} else if (!allow_cur && hp == histptr) {
|
||||||
bi_errorf("%s: invalid range", str);
|
bi_errorf("%s: %s", str, "invalid range");
|
||||||
hp = NULL;
|
hp = NULL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -399,7 +401,7 @@ hist_get(const char *str, bool approx, bool allow_cur)
|
|||||||
|
|
||||||
/* the -1 is to avoid the current fc command */
|
/* the -1 is to avoid the current fc command */
|
||||||
if ((n = findhist(histptr - history - 1, 0, str, anchored)) < 0)
|
if ((n = findhist(histptr - history - 1, 0, str, anchored)) < 0)
|
||||||
bi_errorf("%s: not in history", str);
|
bi_errorf("%s: %s", str, "not in history");
|
||||||
else
|
else
|
||||||
hp = &history[n];
|
hp = &history[n];
|
||||||
}
|
}
|
||||||
|
34
jobs.c
34
jobs.c
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.70 2010/08/28 15:48:19 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.71 2010/08/28 18:50:53 tg Exp $");
|
||||||
|
|
||||||
#if HAVE_KILLPG
|
#if HAVE_KILLPG
|
||||||
#define mksh_killpg killpg
|
#define mksh_killpg killpg
|
||||||
@ -276,8 +276,8 @@ j_change(void)
|
|||||||
pid_t ttypgrp;
|
pid_t ttypgrp;
|
||||||
|
|
||||||
if ((ttypgrp = tcgetpgrp(tty_fd)) < 0) {
|
if ((ttypgrp = tcgetpgrp(tty_fd)) < 0) {
|
||||||
warningf(false,
|
warningf(false, "%s: %s: %s", "j_init",
|
||||||
"j_init: tcgetpgrp() failed: %s",
|
"tcgetpgrp() failed",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
ttypgrp_ok = false;
|
ttypgrp_ok = false;
|
||||||
break;
|
break;
|
||||||
@ -292,14 +292,14 @@ j_change(void)
|
|||||||
SS_RESTORE_DFL|SS_FORCE);
|
SS_RESTORE_DFL|SS_FORCE);
|
||||||
if (ttypgrp_ok && kshpgrp != kshpid) {
|
if (ttypgrp_ok && kshpgrp != kshpid) {
|
||||||
if (setpgid(0, kshpid) < 0) {
|
if (setpgid(0, kshpid) < 0) {
|
||||||
warningf(false,
|
warningf(false, "%s: %s: %s", "j_init",
|
||||||
"j_init: setpgid() failed: %s",
|
"setpgid() failed",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
ttypgrp_ok = false;
|
ttypgrp_ok = false;
|
||||||
} else {
|
} else {
|
||||||
if (tcsetpgrp(tty_fd, kshpid) < 0) {
|
if (tcsetpgrp(tty_fd, kshpid) < 0) {
|
||||||
warningf(false,
|
warningf(false, "%s: %s: %s", "j_init",
|
||||||
"j_init: tcsetpgrp() failed: %s",
|
"tcsetpgrp() failed",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
ttypgrp_ok = false;
|
ttypgrp_ok = false;
|
||||||
} else
|
} else
|
||||||
@ -308,7 +308,8 @@ j_change(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (use_tty && !ttypgrp_ok)
|
if (use_tty && !ttypgrp_ok)
|
||||||
warningf(false, "warning: won't have full job control");
|
warningf(false, "%s: %s", "warning",
|
||||||
|
"won't have full job control");
|
||||||
if (tty_fd >= 0)
|
if (tty_fd >= 0)
|
||||||
tcgetattr(tty_fd, &tty_state);
|
tcgetattr(tty_fd, &tty_state);
|
||||||
} else {
|
} else {
|
||||||
@ -494,8 +495,9 @@ exchild(struct op *t, int flags,
|
|||||||
#ifndef MKSH_SMALL
|
#ifndef MKSH_SMALL
|
||||||
if (t->type == TPIPE)
|
if (t->type == TPIPE)
|
||||||
unwind(LLEAVE);
|
unwind(LLEAVE);
|
||||||
internal_warningf("exchild: execute() returned");
|
internal_warningf("%s: %s", "exchild", "execute() returned");
|
||||||
fptreef(shl_out, 2, "exchild: tried to execute {\n%T\n}\n", t);
|
fptreef(shl_out, 2, "%s: tried to execute {\n%T\n}\n",
|
||||||
|
"exchild", t);
|
||||||
shf_flush(shl_out);
|
shf_flush(shl_out);
|
||||||
#endif
|
#endif
|
||||||
unwind(LLEAVE);
|
unwind(LLEAVE);
|
||||||
@ -561,9 +563,9 @@ waitlast(void)
|
|||||||
j = last_job;
|
j = last_job;
|
||||||
if (!j || !(j->flags & JF_STARTED)) {
|
if (!j || !(j->flags & JF_STARTED)) {
|
||||||
if (!j)
|
if (!j)
|
||||||
warningf(true, "waitlast: no last job");
|
warningf(true, "%s: %s", "waitlast", "no last job");
|
||||||
else
|
else
|
||||||
internal_warningf("waitlast: not started");
|
internal_warningf("%s: %s", "waitlast", "not started");
|
||||||
sigprocmask(SIG_SETMASK, &omask, NULL);
|
sigprocmask(SIG_SETMASK, &omask, NULL);
|
||||||
return (125); /* not so arbitrary, non-zero value */
|
return (125); /* not so arbitrary, non-zero value */
|
||||||
}
|
}
|
||||||
@ -754,7 +756,7 @@ j_resume(const char *cp, int bg)
|
|||||||
tty_fd, (long)kshpgrp, strerror(errno));
|
tty_fd, (long)kshpgrp, strerror(errno));
|
||||||
}
|
}
|
||||||
sigprocmask(SIG_SETMASK, &omask, NULL);
|
sigprocmask(SIG_SETMASK, &omask, NULL);
|
||||||
bi_errorf("cannot continue job %s: %s",
|
bi_errorf("%s %s %s", "cannot continue job",
|
||||||
cp, strerror(err));
|
cp, strerror(err));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
@ -916,7 +918,7 @@ j_set_async(Job *j)
|
|||||||
if (async_job && (async_job->flags & (JF_KNOWN|JF_ZOMBIE)) == JF_ZOMBIE)
|
if (async_job && (async_job->flags & (JF_KNOWN|JF_ZOMBIE)) == JF_ZOMBIE)
|
||||||
remove_job(async_job, "async");
|
remove_job(async_job, "async");
|
||||||
if (!(j->flags & JF_STARTED)) {
|
if (!(j->flags & JF_STARTED)) {
|
||||||
internal_warningf("j_async: job not started");
|
internal_warningf("%s: %s", "j_async", "job not started");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
async_job = j;
|
async_job = j;
|
||||||
@ -930,8 +932,8 @@ j_set_async(Job *j)
|
|||||||
if (!oldest) {
|
if (!oldest) {
|
||||||
/* XXX debugging */
|
/* XXX debugging */
|
||||||
if (!(async_job->flags & JF_ZOMBIE) || nzombie != 1) {
|
if (!(async_job->flags & JF_ZOMBIE) || nzombie != 1) {
|
||||||
internal_warningf("j_async: bad nzombie (%d)",
|
internal_warningf("%s: bad nzombie (%d)",
|
||||||
nzombie);
|
"j_async", nzombie);
|
||||||
nzombie = 0;
|
nzombie = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
4
lex.c
4
lex.c
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.118 2010/07/25 11:35:41 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.119 2010/08/28 18:50:53 tg Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* states while lexing word
|
* states while lexing word
|
||||||
@ -944,7 +944,7 @@ yylex(int cf)
|
|||||||
|
|
||||||
#ifndef MKSH_SMALL
|
#ifndef MKSH_SMALL
|
||||||
if (state == SLETARRAY && statep->ls_sletarray.nparen != -1)
|
if (state == SLETARRAY && statep->ls_sletarray.nparen != -1)
|
||||||
yyerror("%s: ')' missing\n", T_synerr);
|
yyerror("%s: '%s' %s\n", T_synerr, ")", "missing");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This done to avoid tests for SHEREDELIM wherever SBASE tested */
|
/* This done to avoid tests for SHEREDELIM wherever SBASE tested */
|
||||||
|
21
main.c
21
main.c
@ -33,7 +33,7 @@
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.168 2010/08/28 15:39:19 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.169 2010/08/28 18:50:54 tg Exp $");
|
||||||
|
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ static const char *initcoms[] = {
|
|||||||
T_typeset, "-x", "HOME", "PATH", "RANDOM", "SHELL", NULL,
|
T_typeset, "-x", "HOME", "PATH", "RANDOM", "SHELL", NULL,
|
||||||
T_typeset, "-i10", "COLUMNS", "LINES", "OPTIND", "PGRP", "PPID",
|
T_typeset, "-i10", "COLUMNS", "LINES", "OPTIND", "PGRP", "PPID",
|
||||||
"RANDOM", "SECONDS", "TMOUT", "USER_ID", NULL,
|
"RANDOM", "SECONDS", "TMOUT", "USER_ID", NULL,
|
||||||
"alias",
|
T_alias,
|
||||||
"integer=typeset -i",
|
"integer=typeset -i",
|
||||||
T_local_typeset,
|
T_local_typeset,
|
||||||
"hash=alias -t", /* not "alias -t --": hash -r needs to work */
|
"hash=alias -t", /* not "alias -t --": hash -r needs to work */
|
||||||
@ -87,7 +87,7 @@ static const char *initcoms[] = {
|
|||||||
"login=exec login",
|
"login=exec login",
|
||||||
NULL,
|
NULL,
|
||||||
/* this is what AT&T ksh seems to track, with the addition of emacs */
|
/* this is what AT&T ksh seems to track, with the addition of emacs */
|
||||||
"alias", "-tU",
|
T_alias, "-tU",
|
||||||
"cat", "cc", "chmod", "cp", "date", "ed", "emacs", "grep", "ls",
|
"cat", "cc", "chmod", "cp", "date", "ed", "emacs", "grep", "ls",
|
||||||
"make", "mv", "pr", "rm", "sed", "sh", "vi", "who", NULL,
|
"make", "mv", "pr", "rm", "sed", "sh", "vi", "who", NULL,
|
||||||
NULL
|
NULL
|
||||||
@ -323,7 +323,7 @@ mksh_init(int argc, const char *argv[])
|
|||||||
if (Flag(FCOMMAND)) {
|
if (Flag(FCOMMAND)) {
|
||||||
s = pushs(SSTRING, ATEMP);
|
s = pushs(SSTRING, ATEMP);
|
||||||
if (!(s->start = s->str = argv[argi++]))
|
if (!(s->start = s->str = argv[argi++]))
|
||||||
errorf("-c requires an argument");
|
errorf("%s %s", "-c", "requires an argument");
|
||||||
#ifdef MKSH_MIDNIGHTBSD01ASH_COMPAT
|
#ifdef MKSH_MIDNIGHTBSD01ASH_COMPAT
|
||||||
/* compatibility to MidnightBSD 0.1 /bin/sh (kludge) */
|
/* compatibility to MidnightBSD 0.1 /bin/sh (kludge) */
|
||||||
if (Flag(FSH) && argv[argi] && !strcmp(argv[argi], "--"))
|
if (Flag(FSH) && argv[argi] && !strcmp(argv[argi], "--"))
|
||||||
@ -633,7 +633,7 @@ shell(Source * volatile s, volatile int toplevel)
|
|||||||
t = compile(s);
|
t = compile(s);
|
||||||
if (t != NULL && t->type == TEOF) {
|
if (t != NULL && t->type == TEOF) {
|
||||||
if (wastty && Flag(FIGNOREEOF) && --attempts > 0) {
|
if (wastty && Flag(FIGNOREEOF) && --attempts > 0) {
|
||||||
shellf("Use 'exit' to leave ksh\n");
|
shellf("Use 'exit' to leave mksh\n");
|
||||||
s->type = SSTDIN;
|
s->type = SSTDIN;
|
||||||
} else if (wastty && !really_exit &&
|
} else if (wastty && !really_exit &&
|
||||||
j_stopped_running()) {
|
j_stopped_running()) {
|
||||||
@ -876,13 +876,12 @@ tty_init(bool init_ttystate, bool need_tty)
|
|||||||
}
|
}
|
||||||
if ((tty_fd = fcntl(tfd, F_DUPFD, FDBASE)) < 0) {
|
if ((tty_fd = fcntl(tfd, F_DUPFD, FDBASE)) < 0) {
|
||||||
if (need_tty)
|
if (need_tty)
|
||||||
warningf(false, "j_ttyinit: dup of tty fd failed: %s",
|
warningf(false, "%s: %s: %s", "j_ttyinit",
|
||||||
strerror(errno));
|
"dup of tty fd failed", strerror(errno));
|
||||||
} else if (fcntl(tty_fd, F_SETFD, FD_CLOEXEC) < 0) {
|
} else if (fcntl(tty_fd, F_SETFD, FD_CLOEXEC) < 0) {
|
||||||
if (need_tty)
|
if (need_tty)
|
||||||
warningf(false,
|
warningf(false, "%s: %s: %s", "j_ttyinit",
|
||||||
"j_ttyinit: can't set close-on-exec flag: %s",
|
"can't set close-on-exec flag", strerror(errno));
|
||||||
strerror(errno));
|
|
||||||
close(tty_fd);
|
close(tty_fd);
|
||||||
tty_fd = -1;
|
tty_fd = -1;
|
||||||
} else if (init_ttystate)
|
} else if (init_ttystate)
|
||||||
@ -1280,7 +1279,7 @@ maketemp(Area *ap, Temp_type type, struct temp **tlist)
|
|||||||
tp->shf = NULL;
|
tp->shf = NULL;
|
||||||
tp->type = type;
|
tp->type = type;
|
||||||
#if HAVE_MKSTEMP
|
#if HAVE_MKSTEMP
|
||||||
shf_snprintf(pathname, len, "%s/mksh.XXXXXXXXXX", dir);
|
shf_snprintf(pathname, len, "%s/%s", dir, "mksh.XXXXXXXXXX");
|
||||||
if ((fd = mkstemp(pathname)) >= 0)
|
if ((fd = mkstemp(pathname)) >= 0)
|
||||||
#else
|
#else
|
||||||
if (tp->name[0] && (fd = open(tp->name, O_CREAT | O_RDWR, 0600)) >= 0)
|
if (tp->name[0] && (fd = open(tp->name, O_CREAT | O_RDWR, 0600)) >= 0)
|
||||||
|
41
misc.c
41
misc.c
@ -29,7 +29,7 @@
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.143 2010/08/28 16:47:09 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.144 2010/08/28 18:50:55 tg Exp $");
|
||||||
|
|
||||||
unsigned char chtypes[UCHAR_MAX + 1]; /* type bits for unsigned char */
|
unsigned char chtypes[UCHAR_MAX + 1]; /* type bits for unsigned char */
|
||||||
|
|
||||||
@ -168,10 +168,11 @@ printoptions(bool verbose)
|
|||||||
octs + 4, oi.opt_width + 4, true);
|
octs + 4, oi.opt_width + 4, true);
|
||||||
} else {
|
} else {
|
||||||
/* short version á la AT&T ksh93 */
|
/* short version á la AT&T ksh93 */
|
||||||
shf_puts("set", shl_stdout);
|
shf_puts(T_set, shl_stdout);
|
||||||
while (i < (int)NELEM(options)) {
|
while (i < (int)NELEM(options)) {
|
||||||
if (Flag(i) && options[i].name)
|
if (Flag(i) && options[i].name)
|
||||||
shprintf(" -o %s", options[i].name);
|
shprintf("%s %s %s", null, "-o",
|
||||||
|
options[i].name);
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
shf_putc('\n', shl_stdout);
|
shf_putc('\n', shl_stdout);
|
||||||
@ -345,7 +346,7 @@ parse_args(const char **argv,
|
|||||||
else if ((i != (size_t)-1) && (options[i].flags & what))
|
else if ((i != (size_t)-1) && (options[i].flags & what))
|
||||||
change_flag((enum sh_flag)i, what, set);
|
change_flag((enum sh_flag)i, what, set);
|
||||||
else {
|
else {
|
||||||
bi_errorf("%s: bad option", go.optarg);
|
bi_errorf("%s: %s", go.optarg, "bad option");
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -399,7 +400,7 @@ parse_args(const char **argv,
|
|||||||
argv[go.optind]);
|
argv[go.optind]);
|
||||||
|
|
||||||
if (arrayset && (!*array || *skip_varname(array, false))) {
|
if (arrayset && (!*array || *skip_varname(array, false))) {
|
||||||
bi_errorf("%s: is not an identifier", array);
|
bi_errorf("%s: %s", array, "is not an identifier");
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
if (sortargs) {
|
if (sortargs) {
|
||||||
@ -456,7 +457,7 @@ bi_getn(const char *as, int *ai)
|
|||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
if (!(rv = getn(as, ai)))
|
if (!(rv = getn(as, ai)))
|
||||||
bi_errorf("%s: bad number", as);
|
bi_errorf("%s: %s", as, "bad number");
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -858,9 +859,10 @@ ksh_getopt(const char **argv, Getopt *go, const char *optionsp)
|
|||||||
go->optarg = go->buf;
|
go->optarg = go->buf;
|
||||||
return (':');
|
return (':');
|
||||||
}
|
}
|
||||||
warningf(true, "%s%s-'%c' requires argument",
|
warningf(true, "%s%s-'%c' %s",
|
||||||
(go->flags & GF_NONAME) ? "" : argv[0],
|
(go->flags & GF_NONAME) ? "" : argv[0],
|
||||||
(go->flags & GF_NONAME) ? "" : ": ", c);
|
(go->flags & GF_NONAME) ? "" : ": ", c,
|
||||||
|
"requires an argument");
|
||||||
if (go->flags & GF_ERROR)
|
if (go->flags & GF_ERROR)
|
||||||
bi_errorfz();
|
bi_errorfz();
|
||||||
return ('?');
|
return ('?');
|
||||||
@ -1289,42 +1291,43 @@ chvt(const char *fn)
|
|||||||
if (stat(dv, &sb)) {
|
if (stat(dv, &sb)) {
|
||||||
strlcpy(dv + 8, fn, sizeof(dv) - 8);
|
strlcpy(dv + 8, fn, sizeof(dv) - 8);
|
||||||
if (stat(dv, &sb))
|
if (stat(dv, &sb))
|
||||||
errorf("chvt: can't find tty %s", fn);
|
errorf("%s: %s %s", "chvt",
|
||||||
|
"can't find tty", fn);
|
||||||
}
|
}
|
||||||
fn = dv;
|
fn = dv;
|
||||||
}
|
}
|
||||||
if (!(sb.st_mode & S_IFCHR))
|
if (!(sb.st_mode & S_IFCHR))
|
||||||
errorf("chvt: not a char device: %s", fn);
|
errorf("%s %s %s", "chvt: not a char", "device", fn);
|
||||||
if ((sb.st_uid != 0) && chown(fn, 0, 0))
|
if ((sb.st_uid != 0) && chown(fn, 0, 0))
|
||||||
warningf(false, "chvt: cannot chown root %s", fn);
|
warningf(false, "%s: %s %s", "chvt", "cannot chown root", fn);
|
||||||
if (((sb.st_mode & 07777) != 0600) && chmod(fn, (mode_t)0600))
|
if (((sb.st_mode & 07777) != 0600) && chmod(fn, (mode_t)0600))
|
||||||
warningf(false, "chvt: cannot chmod 0600 %s", fn);
|
warningf(false, "%s: %s %s", "chvt", "cannot chmod 0600", fn);
|
||||||
#if HAVE_REVOKE
|
#if HAVE_REVOKE
|
||||||
if (revoke(fn))
|
if (revoke(fn))
|
||||||
#endif
|
#endif
|
||||||
warningf(false, "chvt: cannot revoke %s, new shell is"
|
warningf(false, "%s: cannot revoke %s, new shell is"
|
||||||
" potentially insecure", fn);
|
" potentially insecure", "chvt", fn);
|
||||||
}
|
}
|
||||||
if ((fd = open(fn, O_RDWR)) == -1) {
|
if ((fd = open(fn, O_RDWR)) == -1) {
|
||||||
sleep(1);
|
sleep(1);
|
||||||
if ((fd = open(fn, O_RDWR)) == -1)
|
if ((fd = open(fn, O_RDWR)) == -1)
|
||||||
errorf("chvt: cannot open %s", fn);
|
errorf("%s: %s %s", "chvt", "cannot open", fn);
|
||||||
}
|
}
|
||||||
switch (fork()) {
|
switch (fork()) {
|
||||||
case -1:
|
case -1:
|
||||||
errorf("chvt: %s failed", "fork");
|
errorf("%s: %s %s", "chvt", "fork", "failed");
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
if (setsid() == -1)
|
if (setsid() == -1)
|
||||||
errorf("chvt: %s failed", "setsid");
|
errorf("%s: %s %s", "chvt", "setsid", "failed");
|
||||||
if (fn != dv + 1) {
|
if (fn != dv + 1) {
|
||||||
if (ioctl(fd, TIOCSCTTY, NULL) == -1)
|
if (ioctl(fd, TIOCSCTTY, NULL) == -1)
|
||||||
errorf("chvt: %s failed", "TIOCSCTTY");
|
errorf("%s: %s %s", "chvt", "TIOCSCTTY", "failed");
|
||||||
if (tcflush(fd, TCIOFLUSH))
|
if (tcflush(fd, TCIOFLUSH))
|
||||||
errorf("chvt: %s failed", "TCIOFLUSH");
|
errorf("%s: %s %s", "chvt", "TCIOFLUSH", "failed");
|
||||||
}
|
}
|
||||||
ksh_dup2(fd, 0, false);
|
ksh_dup2(fd, 0, false);
|
||||||
ksh_dup2(fd, 1, false);
|
ksh_dup2(fd, 1, false);
|
||||||
|
10
sh.h
10
sh.h
@ -150,7 +150,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EXTERN
|
#ifdef EXTERN
|
||||||
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.409 2010/08/28 17:21:46 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.410 2010/08/28 18:50:55 tg Exp $");
|
||||||
#endif
|
#endif
|
||||||
#define MKSH_VERSION "R39 2010/08/28"
|
#define MKSH_VERSION "R39 2010/08/28"
|
||||||
|
|
||||||
@ -633,6 +633,14 @@ EXTERN const char r_fc_e_[] I__("r=fc -e -");
|
|||||||
EXTERN const char T_local_typeset[] I__("local=typeset");
|
EXTERN const char T_local_typeset[] I__("local=typeset");
|
||||||
#define T__typeset (T_local_typeset + 5) /* "=typeset" */
|
#define T__typeset (T_local_typeset + 5) /* "=typeset" */
|
||||||
#define T_typeset (T_local_typeset + 6) /* "typeset" */
|
#define T_typeset (T_local_typeset + 6) /* "typeset" */
|
||||||
|
EXTERN const char T_palias[] I__("+alias");
|
||||||
|
#define T_alias (T_palias + 1) /* "alias" */
|
||||||
|
EXTERN const char T_punalias[] I__("+unalias");
|
||||||
|
#define T_unalias (T_punalias + 1) /* "unalias" */
|
||||||
|
EXTERN const char T_sgset[] I__("*=set");
|
||||||
|
#define T_set (T_sgset + 2) /* "set" */
|
||||||
|
EXTERN const char T_gbuiltin[] I__("=builtin");
|
||||||
|
#define T_builtin (T_gbuiltin + 1) /* "builtin" */
|
||||||
|
|
||||||
enum temp_type {
|
enum temp_type {
|
||||||
TT_HEREDOC_EXP, /* expanded heredoc */
|
TT_HEREDOC_EXP, /* expanded heredoc */
|
||||||
|
34
shf.c
34
shf.c
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.37 2010/08/28 16:47:11 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/shf.c,v 1.38 2010/08/28 18:50:57 tg Exp $");
|
||||||
|
|
||||||
/* flags to shf_emptybuf() */
|
/* flags to shf_emptybuf() */
|
||||||
#define EB_READSW 0x01 /* about to switch to reading */
|
#define EB_READSW 0x01 /* about to switch to reading */
|
||||||
@ -108,7 +108,7 @@ shf_fdopen(int fd, int sflags, struct shf *shf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(sflags & (SHF_RD | SHF_WR)))
|
if (!(sflags & (SHF_RD | SHF_WR)))
|
||||||
internal_errorf("shf_fdopen: missing read/write");
|
internal_errorf("%s: %s", "shf_fdopen", "missing read/write");
|
||||||
|
|
||||||
if (shf) {
|
if (shf) {
|
||||||
if (bsize) {
|
if (bsize) {
|
||||||
@ -165,9 +165,9 @@ shf_reopen(int fd, int sflags, struct shf *shf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(sflags & (SHF_RD | SHF_WR)))
|
if (!(sflags & (SHF_RD | SHF_WR)))
|
||||||
internal_errorf("shf_reopen: missing read/write");
|
internal_errorf("%s: %s", "shf_reopen", "missing read/write");
|
||||||
if (!shf || !shf->buf || shf->bsize < bsize)
|
if (!shf || !shf->buf || shf->bsize < bsize)
|
||||||
internal_errorf("shf_reopen: bad shf/buf/bsize");
|
internal_errorf("%s: %s", "shf_reopen", "bad shf/buf/bsize");
|
||||||
|
|
||||||
/* assumes shf->buf and shf->bsize already set up */
|
/* assumes shf->buf and shf->bsize already set up */
|
||||||
shf->fd = fd;
|
shf->fd = fd;
|
||||||
@ -196,7 +196,7 @@ shf_sopen(char *buf, int bsize, int sflags, struct shf *shf)
|
|||||||
{
|
{
|
||||||
/* can't have a read+write string */
|
/* can't have a read+write string */
|
||||||
if (!(!(sflags & SHF_RD) ^ !(sflags & SHF_WR)))
|
if (!(!(sflags & SHF_RD) ^ !(sflags & SHF_WR)))
|
||||||
internal_errorf("shf_sopen: flags 0x%x", sflags);
|
internal_errorf("%s: flags 0x%X", "shf_sopen", sflags);
|
||||||
|
|
||||||
if (!shf) {
|
if (!shf) {
|
||||||
shf = alloc(sizeof(struct shf), ATEMP);
|
shf = alloc(sizeof(struct shf), ATEMP);
|
||||||
@ -289,7 +289,7 @@ shf_flush(struct shf *shf)
|
|||||||
return ((shf->flags & SHF_WR) ? EOF : 0);
|
return ((shf->flags & SHF_WR) ? EOF : 0);
|
||||||
|
|
||||||
if (shf->fd < 0)
|
if (shf->fd < 0)
|
||||||
internal_errorf("shf_flush: no fd");
|
internal_errorf("%s: %s", "shf_flush", "no fd");
|
||||||
|
|
||||||
if (shf->flags & SHF_ERROR) {
|
if (shf->flags & SHF_ERROR) {
|
||||||
errno = shf->errno_;
|
errno = shf->errno_;
|
||||||
@ -319,7 +319,7 @@ shf_emptybuf(struct shf *shf, int flags)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!(shf->flags & SHF_STRING) && shf->fd < 0)
|
if (!(shf->flags & SHF_STRING) && shf->fd < 0)
|
||||||
internal_errorf("shf_emptybuf: no fd");
|
internal_errorf("%s: %s", "shf_emptybuf", "no fd");
|
||||||
|
|
||||||
if (shf->flags & SHF_ERROR) {
|
if (shf->flags & SHF_ERROR) {
|
||||||
errno = shf->errno_;
|
errno = shf->errno_;
|
||||||
@ -401,7 +401,7 @@ shf_fillbuf(struct shf *shf)
|
|||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
if (shf->fd < 0)
|
if (shf->fd < 0)
|
||||||
internal_errorf("shf_fillbuf: no fd");
|
internal_errorf("%s: %s", "shf_fillbuf", "no fd");
|
||||||
|
|
||||||
if (shf->flags & (SHF_EOF | SHF_ERROR)) {
|
if (shf->flags & (SHF_EOF | SHF_ERROR)) {
|
||||||
if (shf->flags & SHF_ERROR)
|
if (shf->flags & SHF_ERROR)
|
||||||
@ -444,10 +444,10 @@ shf_read(char *buf, int bsize, struct shf *shf)
|
|||||||
int ncopy;
|
int ncopy;
|
||||||
|
|
||||||
if (!(shf->flags & SHF_RD))
|
if (!(shf->flags & SHF_RD))
|
||||||
internal_errorf("shf_read: flags %x", shf->flags);
|
internal_errorf("%s: flags 0x%X", "shf_read", shf->flags);
|
||||||
|
|
||||||
if (bsize <= 0)
|
if (bsize <= 0)
|
||||||
internal_errorf("shf_read: bsize %d", bsize);
|
internal_errorf("%s: %s %d", "shf_write", "bsize", bsize);
|
||||||
|
|
||||||
while (bsize > 0) {
|
while (bsize > 0) {
|
||||||
if (shf->rnleft == 0 &&
|
if (shf->rnleft == 0 &&
|
||||||
@ -479,7 +479,7 @@ shf_getse(char *buf, int bsize, struct shf *shf)
|
|||||||
char *orig_buf = buf;
|
char *orig_buf = buf;
|
||||||
|
|
||||||
if (!(shf->flags & SHF_RD))
|
if (!(shf->flags & SHF_RD))
|
||||||
internal_errorf("shf_getse: flags %x", shf->flags);
|
internal_errorf("%s: flags 0x%X", "shf_getse", shf->flags);
|
||||||
|
|
||||||
if (bsize <= 0)
|
if (bsize <= 0)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
@ -514,7 +514,7 @@ int
|
|||||||
shf_getchar(struct shf *shf)
|
shf_getchar(struct shf *shf)
|
||||||
{
|
{
|
||||||
if (!(shf->flags & SHF_RD))
|
if (!(shf->flags & SHF_RD))
|
||||||
internal_errorf("shf_getchar: flags %x", shf->flags);
|
internal_errorf("%s: flags 0x%X", "shf_getchar", shf->flags);
|
||||||
|
|
||||||
if (shf->rnleft == 0 && (shf_fillbuf(shf) == EOF || shf->rnleft == 0))
|
if (shf->rnleft == 0 && (shf_fillbuf(shf) == EOF || shf->rnleft == 0))
|
||||||
return (EOF);
|
return (EOF);
|
||||||
@ -529,7 +529,7 @@ int
|
|||||||
shf_ungetc(int c, struct shf *shf)
|
shf_ungetc(int c, struct shf *shf)
|
||||||
{
|
{
|
||||||
if (!(shf->flags & SHF_RD))
|
if (!(shf->flags & SHF_RD))
|
||||||
internal_errorf("shf_ungetc: flags %x", shf->flags);
|
internal_errorf("%s: flags 0x%X", "shf_ungetc", shf->flags);
|
||||||
|
|
||||||
if ((shf->flags & SHF_ERROR) || c == EOF ||
|
if ((shf->flags & SHF_ERROR) || c == EOF ||
|
||||||
(shf->rp == shf->buf && shf->rnleft))
|
(shf->rp == shf->buf && shf->rnleft))
|
||||||
@ -564,7 +564,7 @@ int
|
|||||||
shf_putchar(int c, struct shf *shf)
|
shf_putchar(int c, struct shf *shf)
|
||||||
{
|
{
|
||||||
if (!(shf->flags & SHF_WR))
|
if (!(shf->flags & SHF_WR))
|
||||||
internal_errorf("shf_putchar: flags %x", shf->flags);
|
internal_errorf("%s: flags 0x%X", "shf_putchar", shf->flags);
|
||||||
|
|
||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
return (EOF);
|
return (EOF);
|
||||||
@ -574,7 +574,7 @@ shf_putchar(int c, struct shf *shf)
|
|||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (shf->fd < 0)
|
if (shf->fd < 0)
|
||||||
internal_errorf("shf_putchar: no fd");
|
internal_errorf("%s: %s", "shf_putchar", "no fd");
|
||||||
if (shf->flags & SHF_ERROR) {
|
if (shf->flags & SHF_ERROR) {
|
||||||
errno = shf->errno_;
|
errno = shf->errno_;
|
||||||
return (EOF);
|
return (EOF);
|
||||||
@ -618,10 +618,10 @@ shf_write(const char *buf, int nbytes, struct shf *shf)
|
|||||||
int n, ncopy, orig_nbytes = nbytes;
|
int n, ncopy, orig_nbytes = nbytes;
|
||||||
|
|
||||||
if (!(shf->flags & SHF_WR))
|
if (!(shf->flags & SHF_WR))
|
||||||
internal_errorf("shf_write: flags %x", shf->flags);
|
internal_errorf("%s: flags 0x%X", "shf_write", shf->flags);
|
||||||
|
|
||||||
if (nbytes < 0)
|
if (nbytes < 0)
|
||||||
internal_errorf("shf_write: nbytes %d", nbytes);
|
internal_errorf("%s: %s %d", "shf_write", "nbytes", nbytes);
|
||||||
|
|
||||||
/* Don't buffer if buffer is empty and we're writting a large amount. */
|
/* Don't buffer if buffer is empty and we're writting a large amount. */
|
||||||
if ((ncopy = shf->wnleft) &&
|
if ((ncopy = shf->wnleft) &&
|
||||||
|
19
syn.c
19
syn.c
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.49 2010/07/17 22:09:39 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.50 2010/08/28 18:50:58 tg Exp $");
|
||||||
|
|
||||||
struct nesting_state {
|
struct nesting_state {
|
||||||
int start_token; /* token than began nesting (eg, FOR) */
|
int start_token; /* token than began nesting (eg, FOR) */
|
||||||
@ -181,7 +181,7 @@ synio(int cf)
|
|||||||
if (*ident != 0) /* unquoted */
|
if (*ident != 0) /* unquoted */
|
||||||
iop->flag |= IOEVAL;
|
iop->flag |= IOEVAL;
|
||||||
if (herep > &heres[HERES - 1])
|
if (herep > &heres[HERES - 1])
|
||||||
yyerror("too many <<s\n");
|
yyerror("too many %ss\n", "<<");
|
||||||
*herep++ = iop;
|
*herep++ = iop;
|
||||||
} else
|
} else
|
||||||
iop->name = yylval.cp;
|
iop->name = yylval.cp;
|
||||||
@ -257,7 +257,8 @@ get_command(int cf)
|
|||||||
case REDIR:
|
case REDIR:
|
||||||
while ((iop = synio(cf)) != NULL) {
|
while ((iop = synio(cf)) != NULL) {
|
||||||
if (iopn >= NUFILE)
|
if (iopn >= NUFILE)
|
||||||
yyerror("too many redirections\n");
|
yyerror("too many %ss\n",
|
||||||
|
"redirection");
|
||||||
iops[iopn++] = iop;
|
iops[iopn++] = iop;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -403,8 +404,8 @@ get_command(int cf)
|
|||||||
t = newtp((c == FOR) ? TFOR : TSELECT);
|
t = newtp((c == FOR) ? TFOR : TSELECT);
|
||||||
musthave(LWORD, ARRAYVAR);
|
musthave(LWORD, ARRAYVAR);
|
||||||
if (!is_wdvarname(yylval.cp, true))
|
if (!is_wdvarname(yylval.cp, true))
|
||||||
yyerror("%s: bad identifier\n",
|
yyerror("%s: %s\n", c == FOR ? "for" : "select",
|
||||||
c == FOR ? "for" : "select");
|
"bad identifier");
|
||||||
strdupx(t->str, ident, ATEMP);
|
strdupx(t->str, ident, ATEMP);
|
||||||
nesting_push(&old_nesting, c);
|
nesting_push(&old_nesting, c);
|
||||||
t->vars = wordlist();
|
t->vars = wordlist();
|
||||||
@ -466,7 +467,7 @@ get_command(int cf)
|
|||||||
|
|
||||||
while ((iop = synio(syniocf)) != NULL) {
|
while ((iop = synio(syniocf)) != NULL) {
|
||||||
if (iopn >= NUFILE)
|
if (iopn >= NUFILE)
|
||||||
yyerror("too many redirections\n");
|
yyerror("too many %ss\n", "redirection");
|
||||||
iops[iopn++] = iop;
|
iops[iopn++] = iop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -622,7 +623,7 @@ function_body(char *name,
|
|||||||
*/
|
*/
|
||||||
for (p = sname; *p; p++)
|
for (p = sname; *p; p++)
|
||||||
if (ctype(*p, C_QUOTE))
|
if (ctype(*p, C_QUOTE))
|
||||||
yyerror("%s: invalid function name\n", sname);
|
yyerror("%s: %s\n", sname, "invalid function name");
|
||||||
|
|
||||||
/* Note that POSIX allows only compound statements after foo(), sh and
|
/* Note that POSIX allows only compound statements after foo(), sh and
|
||||||
* AT&T ksh allow any command, go with the later since it shouldn't
|
* AT&T ksh allow any command, go with the later since it shouldn't
|
||||||
@ -796,7 +797,7 @@ syntaxerr(const char *what)
|
|||||||
goto Again;
|
goto Again;
|
||||||
}
|
}
|
||||||
/* don't quote the EOF */
|
/* don't quote the EOF */
|
||||||
yyerror("%s: unexpected EOF\n", T_synerr);
|
yyerror("%s: %s\n", T_synerr, "unexpected EOF");
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
|
|
||||||
case LWORD:
|
case LWORD:
|
||||||
@ -882,7 +883,7 @@ assign_command(char *s)
|
|||||||
{
|
{
|
||||||
if (!*s)
|
if (!*s)
|
||||||
return (0);
|
return (0);
|
||||||
return ((strcmp(s, "alias") == 0) ||
|
return ((strcmp(s, T_alias) == 0) ||
|
||||||
(strcmp(s, "export") == 0) ||
|
(strcmp(s, "export") == 0) ||
|
||||||
(strcmp(s, "readonly") == 0) ||
|
(strcmp(s, "readonly") == 0) ||
|
||||||
(strcmp(s, T_typeset) == 0));
|
(strcmp(s, T_typeset) == 0));
|
||||||
|
16
var.c
16
var.c
@ -26,7 +26,7 @@
|
|||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.110 2010/07/25 11:35:43 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.111 2010/08/28 18:50:58 tg Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Variables
|
* Variables
|
||||||
@ -393,7 +393,7 @@ intval(struct tbl *vp)
|
|||||||
base = getint(vp, &num, false);
|
base = getint(vp, &num, false);
|
||||||
if (base == -1)
|
if (base == -1)
|
||||||
/* XXX check calls - is error here ok by POSIX? */
|
/* XXX check calls - is error here ok by POSIX? */
|
||||||
errorf("%s: bad number", str_val(vp));
|
errorf("%s: %s", str_val(vp), "bad number");
|
||||||
return (num);
|
return (num);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,7 +406,7 @@ setstr(struct tbl *vq, const char *s, int error_ok)
|
|||||||
|
|
||||||
error_ok &= ~0x4;
|
error_ok &= ~0x4;
|
||||||
if ((vq->flag & RDONLY) && !no_ro_check) {
|
if ((vq->flag & RDONLY) && !no_ro_check) {
|
||||||
warningf(true, "%s: is read only", vq->name);
|
warningf(true, "%s: %s", vq->name, "is read only");
|
||||||
if (!error_ok)
|
if (!error_ok)
|
||||||
errorfz();
|
errorfz();
|
||||||
return (0);
|
return (0);
|
||||||
@ -685,8 +685,8 @@ typeset(const char *var, Tflag set, Tflag clr, int field, int base)
|
|||||||
mkssert(*var != 0);
|
mkssert(*var != 0);
|
||||||
if (*val == '[') {
|
if (*val == '[') {
|
||||||
if (set_refflag)
|
if (set_refflag)
|
||||||
errorf("%s: reference variable cannot be an array",
|
errorf("%s: %s", var,
|
||||||
var);
|
"reference variable cannot be an array");
|
||||||
len = array_ref_len(val);
|
len = array_ref_len(val);
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
@ -722,7 +722,7 @@ typeset(const char *var, Tflag set, Tflag clr, int field, int base)
|
|||||||
/* Prevent typeset from creating a local PATH/ENV/SHELL */
|
/* Prevent typeset from creating a local PATH/ENV/SHELL */
|
||||||
if (Flag(FRESTRICTED) && (strcmp(tvar, "PATH") == 0 ||
|
if (Flag(FRESTRICTED) && (strcmp(tvar, "PATH") == 0 ||
|
||||||
strcmp(tvar, "ENV") == 0 || strcmp(tvar, "SHELL") == 0))
|
strcmp(tvar, "ENV") == 0 || strcmp(tvar, "SHELL") == 0))
|
||||||
errorf("%s: restricted", tvar);
|
errorf("%s: %s", tvar, "restricted");
|
||||||
|
|
||||||
vp = (set&LOCAL) ? local(tvar, (set & LOCAL_COPY) ? true : false) :
|
vp = (set&LOCAL) ? local(tvar, (set & LOCAL_COPY) ? true : false) :
|
||||||
global(tvar);
|
global(tvar);
|
||||||
@ -756,7 +756,7 @@ typeset(const char *var, Tflag set, Tflag clr, int field, int base)
|
|||||||
if ((vpbase->flag&RDONLY) &&
|
if ((vpbase->flag&RDONLY) &&
|
||||||
(val || clr || (set & ~EXPORT)))
|
(val || clr || (set & ~EXPORT)))
|
||||||
/* XXX check calls - is error here ok by POSIX? */
|
/* XXX check calls - is error here ok by POSIX? */
|
||||||
errorf("%s: is read only", tvar);
|
errorf("%s: %s", tvar, "is read only");
|
||||||
afree(tvar, ATEMP);
|
afree(tvar, ATEMP);
|
||||||
|
|
||||||
/* most calls are with set/clr == 0 */
|
/* most calls are with set/clr == 0 */
|
||||||
@ -1389,7 +1389,7 @@ set_array(const char *var, bool reset, const char **vals)
|
|||||||
|
|
||||||
/* Note: AT&T ksh allows set -A but not set +A of a read-only var */
|
/* Note: AT&T ksh allows set -A but not set +A of a read-only var */
|
||||||
if ((vp->flag&RDONLY))
|
if ((vp->flag&RDONLY))
|
||||||
errorf("%s: is read only", var);
|
errorf("%s: %s", var, "is read only");
|
||||||
/* This code is quite non-optimal */
|
/* This code is quite non-optimal */
|
||||||
if (reset)
|
if (reset)
|
||||||
/* trash existing values and attributes */
|
/* trash existing values and attributes */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user