make more internal consistency checks #ifndef MKSH_SMALL
This commit is contained in:
parent
435bc124ef
commit
2f41503f8e
7
var.c
7
var.c
@ -27,7 +27,7 @@
|
|||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.156 2012/11/20 17:42:32 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.157 2012/11/20 18:06:53 tg Exp $");
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Variables
|
* Variables
|
||||||
@ -417,12 +417,15 @@ setstr(struct tbl *vq, const char *s, int error_ok)
|
|||||||
if (!(vq->flag&INTEGER)) {
|
if (!(vq->flag&INTEGER)) {
|
||||||
/* string dest */
|
/* string dest */
|
||||||
if ((vq->flag&ALLOC)) {
|
if ((vq->flag&ALLOC)) {
|
||||||
|
#ifndef MKSH_SMALL
|
||||||
/* debugging */
|
/* debugging */
|
||||||
if (s >= vq->val.s &&
|
if (s >= vq->val.s &&
|
||||||
s <= vq->val.s + strlen(vq->val.s))
|
s <= vq->val.s + strlen(vq->val.s)) {
|
||||||
internal_errorf(
|
internal_errorf(
|
||||||
"setstr: %s=%s: assigning to self",
|
"setstr: %s=%s: assigning to self",
|
||||||
vq->name, s);
|
vq->name, s);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
afree(vq->val.s, vq->areap);
|
afree(vq->val.s, vq->areap);
|
||||||
}
|
}
|
||||||
vq->flag &= ~(ISSET|ALLOC);
|
vq->flag &= ~(ISSET|ALLOC);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user