From 601474e2120616205ea1fc68097a8196efc4d54e Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sat, 11 May 2002 15:30:34 +0000 Subject: [PATCH] Small fixes in diesel library --- lib/diesel.c | 4 ++-- lib/mbdiesel.c | 17 +++++++++++------ mbfido/ptic.c | 3 +++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/diesel.c b/lib/diesel.c index fafc35b9..a4a97d0a 100644 --- a/lib/diesel.c +++ b/lib/diesel.c @@ -342,8 +342,8 @@ documented above, in outstring. #endif struct mfent { - char *fname; /* Function name */ - int (*ffunc)(); /* Evaluation function */ + char *fname; /* Function name */ + int (*ffunc)(int, char *[], char *); /* Evaluation function */ }; #define Mfunc(x) static int x( int, char *[], char *);\ diff --git a/lib/mbdiesel.c b/lib/mbdiesel.c index 1a292b19..85a1f406 100644 --- a/lib/mbdiesel.c +++ b/lib/mbdiesel.c @@ -76,7 +76,7 @@ void MacroVars( const char *codes, const char *fmt, ...) } dieselrc=diesel(tmp1,tmp2); if (dieselrc) { - Syslog('!', "MacroVars error %d argument %d", dieselrc, j); + Syslog('!', "MacroVars error %d argument %d, macro %c type %c", dieselrc, j, codes[j], fmt[j]); } } va_end(ap); @@ -192,11 +192,11 @@ char *ParseMacro( const char *line, int *dieselrc) /* * Add random fortune cookie to the macrovars */ -void Cookie(void); -void Cookie(void) +void Cookie(int); +void Cookie(int HtmlMode) { FILE *olf; - char *fname; + char *fname, outbuf[256]; long recno, records; MacroVars("F", "s", ""); @@ -221,7 +221,12 @@ void Cookie(void) if (fseek(olf, olhdr.hdrsize + (recno * olhdr.recsize), SEEK_SET) == 0) { if (fread(&ol, olhdr.recsize, 1, olf) == 1) { - MacroVars("F", "s", ol.Oneline); + if (HtmlMode) { + html_massage(ol.Oneline, outbuf); + MacroVars("F", "s", outbuf); + } else { + MacroVars("F", "s", ol.Oneline); + } } else { WriteError("Can't read record %d from %s", recno, fname); } @@ -433,7 +438,7 @@ FILE *OpenMacro(const char *filename, int Language, int htmlmode) MacroVars("HLMNOSTUVYZ", "ssssssssssd", CFG.www_url, CFG.location, CFG.sysdomain, CFG.bbs_name, temp, CFG.sysop_name, CFG.comment, CFG.sysop, VERSION, aka, 0); } - Cookie(); + Cookie(htmlmode); } free(aka); diff --git a/mbfido/ptic.c b/mbfido/ptic.c index 19a0224a..14d5dead 100644 --- a/mbfido/ptic.c +++ b/mbfido/ptic.c @@ -771,8 +771,11 @@ int ProcessTic(fa_list *sbl) Magic_CopyFile(); Magic_UnpackFile(); Magic_AdoptFile(); + Syslog('f', "Almost at end of ptic"); sprintf(Temp, "%s/%s", TIC.Inbound, TIC.TicName); + Syslog('f', "About to erase \"%s\"", Temp); + unlink(Temp); free(Temp); return 0;