summaryrefslogtreecommitdiff
path: root/pico/line.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2013-10-13 02:08:28 -0600
committerEduardo Chappa <chappa@washington.edu>2013-10-13 02:08:28 -0600
commitee95edb6a42df4b45c82080c32f852781f289a02 (patch)
tree1fc71517846468677163b76dbf2400b59d7997b5 /pico/line.c
parent30a979ab1460a57d466a6a5cc6adb96eac452ce4 (diff)
downloadalpine-ee95edb6a42df4b45c82080c32f852781f289a02.tar.xz
* Fixes in Pico so that it will crash in big files, instead of looping
forever. Todo: see how this can be improved. * Add support for UID EXPUNGE in selected folders.
Diffstat (limited to 'pico/line.c')
-rw-r--r--pico/line.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pico/line.c b/pico/line.c
index e5df3670..d1fb31e4 100644
--- a/pico/line.c
+++ b/pico/line.c
@@ -73,6 +73,7 @@ lalloc(int used)
register LINE *lp;
register int size;
EML eml;
+ static int displayed = 0;
if((size = (used+NBLOCK-1) & ~(NBLOCK-1)) > NLINE)
size *= 2;
@@ -80,9 +81,10 @@ lalloc(int used)
if (size == 0) /* Assume that an empty */
size = NBLOCK; /* line is for type-in. */
- if ((lp = (LINE *) malloc(sizeof(LINE)+(size*sizeof(CELL)))) == NULL) {
+ if (displayed == 0 && (lp = (LINE *) malloc(sizeof(LINE)+(size*sizeof(CELL)))) == NULL){
eml.s = comatose(size);
- emlwrite("Cannot allocate %s bytes", &eml);
+ emlwrite("Cannot allocate %s bytes (read file incomplete)", &eml);
+ displayed++;
return (NULL);
}