more cleanup; incidentally, replacing libc function with syscall maybe speedup

9t 4d 1i
This commit is contained in:
tg
2006-11-10 04:22:13 +00:00
parent 5dff5df5e5
commit 208c45da25
2 changed files with 15 additions and 7 deletions

View File

@@ -3,7 +3,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.29 2006/11/10 04:03:59 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.30 2006/11/10 04:22:13 tg Exp $");
#if !defined(__sun__)
#define DO_HISTORY
@@ -247,8 +247,7 @@ c_fc(char **wp)
return 1;
}
n = fstat(shf_fileno(shf), &statb) < 0 ? 128 :
statb.st_size + 1;
n = stat(tf->name, &statb) < 0 ? 128 : statb.st_size + 1;
Xinit(xs, xp, n, hist_source->areap);
while ((n = shf_read(xp, Xnleft(xs, xp), shf)) > 0) {
xp += n;