don’t leak memory (pdksh did), and forgot a hunk

This commit is contained in:
tg 2011-03-27 01:30:38 +00:00
parent 5f31b8c97a
commit ad3707d17d
2 changed files with 8 additions and 3 deletions

View File

@ -38,7 +38,7 @@
#endif
#endif
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.180 2011/03/26 21:46:02 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.181 2011/03/27 01:30:36 tg Exp $");
#if HAVE_KILLPG
/*
@ -2700,7 +2700,9 @@ test_eval(Test_env *te, Test_op op, const char *opnd1, const char *opnd2,
*/
nv = shf_smprintf("%s+", opnd1);
return (stat(nv, &b1) == 0 && S_ISCDF(b1.st_mode));
i = (stat(nv, &b1) == 0 && S_ISCDF(b1.st_mode));
afree(nv, ATEMP);
return (i);
}
#else
return (0);

5
sh.h
View File

@ -154,7 +154,7 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.454 2011/03/26 21:46:06 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.455 2011/03/27 01:30:38 tg Exp $");
#endif
#define MKSH_VERSION "R39 2011/03/26"
@ -274,6 +274,9 @@ typedef u_int8_t uint8_t;
#ifndef S_ISSOCK
#define S_ISSOCK(m) ((m & 0170000) == 0140000)
#endif
#if !defined(S_ISCDF) && defined(S_CDF)
#define S_ISCDF(m) (S_ISDIR(m) && ((m) & S_CDF))
#endif
#ifndef DEFFILEMODE
#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
#endif