--- loncom/cgi/mimeTeX/gifsave.c 2007/10/09 21:41:41 1.3 +++ loncom/cgi/mimeTeX/gifsave.c 2008/12/04 12:17:13 1.4 @@ -1,4 +1,4 @@ -/* $Id: gifsave.c,v 1.3 2007/10/09 21:41:41 albertel Exp $ */ +/* $Id: gifsave.c,v 1.4 2008/12/04 12:17:13 riegler Exp $ */ /************************************************************************** * * FILE gifsave.c @@ -76,6 +76,8 @@ static int isCloseOutFile = 0; /* " */ #endif /* " */ int gifSize = 0; /* " #bytes comprising gif */ int maxgifSize = MAXGIFSZ; /* " max #bytes written to OutBuffer */ +extern int iscachecontenttype; /* " true to cache mime content-type */ +extern char contenttype[2048]; /* " content-type:, etc. buffer */ /* used when writing to a file bitwise */ static Byte Buffer[256]; /* there must be one more than `needed' */ @@ -196,7 +198,10 @@ Create(const char *filename) if ( *filename != '\000' ) /* " */ { if ((OutFile = fopen(filename, "wb")) == NULL) return GIF_ERRCREATE; - isCloseOutFile = 1; } /* (added by j.forkosh) */ + isCloseOutFile = 1; /* (added by j.forkosh) */ + if ( iscachecontenttype ) /* " cache headers in file */ + if ( *contenttype != '\000' ) /* " have headers in buffer*/ + fputs(contenttype,OutFile); } /* " write buffered headers*/ else /* " */ OutBuffer = (Byte *)filename; /* " */ return GIF_OK;