summaryrefslogtreecommitdiff
path: root/imap/src/osdep/unix/scandir.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2013-11-02 02:51:18 -0600
committerEduardo Chappa <chappa@washington.edu>2013-11-02 02:51:18 -0600
commit7fe712882b909931088a318c08041b0e7974a000 (patch)
tree2770f9b084e2efc7fc55e96e9bf4352cf2ff33a3 /imap/src/osdep/unix/scandir.c
parentbdfc834badee92ceeb2befe02f1d065ced5b9ddf (diff)
downloadalpine-7fe712882b909931088a318c08041b0e7974a000.tar.xz
* Update to version 2.19.1
* Upgrade UW-IMAP to Panda IMAP from https://github.com/jonabbey/panda-imap. * Replace tabs by spaces in From and Subject fields to control for size in screen of these fields. Change only in index screen display.
Diffstat (limited to 'imap/src/osdep/unix/scandir.c')
-rw-r--r--imap/src/osdep/unix/scandir.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/imap/src/osdep/unix/scandir.c b/imap/src/osdep/unix/scandir.c
index 878343e8..c5e4541b 100644
--- a/imap/src/osdep/unix/scandir.c
+++ b/imap/src/osdep/unix/scandir.c
@@ -1,4 +1,18 @@
/* ========================================================================
+ * Copyright 2008-2009 Mark Crispin
+ * ========================================================================
+ */
+
+/*
+ * Program: Scan directories
+ *
+ * Author: Mark Crispin
+ *
+ * Date: 1 August 1988
+ * Last Edited: 12 June 2009
+ *
+ * Previous versions of this file were:
+ *
* Copyright 1988-2006 University of Washington
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -10,21 +24,6 @@
*
* ========================================================================
*/
-
-/*
- * Program: Scan directories
- *
- * Author: Mark Crispin
- * Networks and Distributed Computing
- * Computing & Communications
- * University of Washington
- * Administration Building, AG-44
- * Seattle, WA 98195
- * Internet: MRC@CAC.Washington.EDU
- *
- * Date: 1 August 1988
- * Last Edited: 15 September 2006
- */
/* Emulator for BSD scandir() call
* Accepts: directory name
@@ -43,7 +42,8 @@ int scandir (char *dirname,struct direct ***namelist,select_t select,
long nlmax;
DIR *dirp = opendir (dirname);/* open directory and get status poop */
if ((!dirp) || (fstat (dirp->dd_fd,&stb) < 0)) return -1;
- nlmax = stb.st_size / 24; /* guesstimate at number of files */
+ /* guesstimate at number of files */
+ nlmax = max (stb.st_size / 24,32);
names = (struct direct **) fs_get (nlmax * sizeof (struct direct *));
nitems = 0; /* initially none found */
while (d = readdir (dirp)) { /* read directory item */