Small fixes in diesel library

This commit is contained in:
Michiel Broek 2002-05-11 15:30:34 +00:00
parent 741e8a077d
commit 601474e212
3 changed files with 16 additions and 8 deletions

View File

@ -342,8 +342,8 @@ documented above, in outstring.
#endif #endif
struct mfent { struct mfent {
char *fname; /* Function name */ char *fname; /* Function name */
int (*ffunc)(); /* Evaluation function */ int (*ffunc)(int, char *[], char *); /* Evaluation function */
}; };
#define Mfunc(x) static int x( int, char *[], char *);\ #define Mfunc(x) static int x( int, char *[], char *);\

View File

@ -76,7 +76,7 @@ void MacroVars( const char *codes, const char *fmt, ...)
} }
dieselrc=diesel(tmp1,tmp2); dieselrc=diesel(tmp1,tmp2);
if (dieselrc) { 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); va_end(ap);
@ -192,11 +192,11 @@ char *ParseMacro( const char *line, int *dieselrc)
/* /*
* Add random fortune cookie to the macrovars * Add random fortune cookie to the macrovars
*/ */
void Cookie(void); void Cookie(int);
void Cookie(void) void Cookie(int HtmlMode)
{ {
FILE *olf; FILE *olf;
char *fname; char *fname, outbuf[256];
long recno, records; long recno, records;
MacroVars("F", "s", ""); MacroVars("F", "s", "");
@ -221,7 +221,12 @@ void Cookie(void)
if (fseek(olf, olhdr.hdrsize + (recno * olhdr.recsize), SEEK_SET) == 0) { if (fseek(olf, olhdr.hdrsize + (recno * olhdr.recsize), SEEK_SET) == 0) {
if (fread(&ol, olhdr.recsize, 1, olf) == 1) { 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 { } else {
WriteError("Can't read record %d from %s", recno, fname); 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, MacroVars("HLMNOSTUVYZ", "ssssssssssd", CFG.www_url, CFG.location, CFG.sysdomain, CFG.bbs_name, temp,
CFG.sysop_name, CFG.comment, CFG.sysop, VERSION, aka, 0); CFG.sysop_name, CFG.comment, CFG.sysop, VERSION, aka, 0);
} }
Cookie(); Cookie(htmlmode);
} }
free(aka); free(aka);

View File

@ -771,8 +771,11 @@ int ProcessTic(fa_list *sbl)
Magic_CopyFile(); Magic_CopyFile();
Magic_UnpackFile(); Magic_UnpackFile();
Magic_AdoptFile(); Magic_AdoptFile();
Syslog('f', "Almost at end of ptic");
sprintf(Temp, "%s/%s", TIC.Inbound, TIC.TicName); sprintf(Temp, "%s/%s", TIC.Inbound, TIC.TicName);
Syslog('f', "About to erase \"%s\"", Temp);
unlink(Temp); unlink(Temp);
free(Temp); free(Temp);
return 0; return 0;