$Log$
+ Revision 601.100 2003/01/01 08:07:46 error
+ * commands.c: bugfix for reading from FILE pointers; affected quote, print
+ and external editor.
+
Revision 601.99 2002/12/28 05:33:29 ajc
* ical_dezonify: set is_utc=1 even if we didn't convert from some arbitrary
timezone. Presumably this means the time was already UTC, and we really
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
/* Read the entire message body into memory */
if (fpin) {
+ size_t got = 0;
+
fseek(fpin, 0, SEEK_END);
i = ftell(fpin);
rewind(fpin);
logoff(NULL, 3);
}
- g = fread(buffer, i, 1, fpin);
- if (g == 1) {
+ while (got < i) {
+ size_t g;
+
+ g = fread(buffer + got, 1, i - got, fpin);
+ got += g;
+ if (g < i - got) {
+ /* Interrupted system call, keep going */
+ if (errno == EINTR)
+ continue;
+ /* At this point we have either EOF or error */
+ i = got;
+ break;
+ }
buffer[i] = 0;
}
- else {
- buffer[0] = 0;
- }
} else {
buffer = text;
}