optimisation: s is never NULL or bigger than sbeg
This commit is contained in:
parent
19b711692f
commit
4f81a0dbb6
4
eval.c
4
eval.c
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.47 2008/07/12 16:56:38 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.48 2008/10/24 20:52:22 tg Exp $");
|
||||||
|
|
||||||
#ifdef MKSH_SMALL
|
#ifdef MKSH_SMALL
|
||||||
#define MKSH_NOPWNAM
|
#define MKSH_NOPWNAM
|
||||||
@ -477,7 +477,7 @@ expand(const char *cp, /* input word */
|
|||||||
break;
|
break;
|
||||||
p--;
|
p--;
|
||||||
}
|
}
|
||||||
end = str_nsave(s, sbeg - s, ATEMP);
|
end = str_nsave_(s, sbeg - s, ATEMP);
|
||||||
d = shf_smprintf("%s%s%s", end, rrep, p);
|
d = shf_smprintf("%s%s%s", end, rrep, p);
|
||||||
afree(end, ATEMP);
|
afree(end, ATEMP);
|
||||||
sbeg = d + (sbeg - s) + strlen(rrep);
|
sbeg = d + (sbeg - s) + strlen(rrep);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user