From 15fcc190319a3deaaeaa544833ea07475e790585 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sun, 29 May 2016 20:52:17 -0400 Subject: re-synching --- ws2a/bugsdata.c | 78 --------------------------------------------------------- 1 file changed, 78 deletions(-) delete mode 100644 ws2a/bugsdata.c (limited to 'ws2a/bugsdata.c') diff --git a/ws2a/bugsdata.c b/ws2a/bugsdata.c deleted file mode 100644 index 0370147..0000000 --- a/ws2a/bugsdata.c +++ /dev/null @@ -1,78 +0,0 @@ -#include -#include -#include -#include - -int main(){ - printf("%s%c%c\n", - "Content-Type:text/html;charset=iso-8859-1",13,10); - FILE* lastfilenum; - lastfilenum = fopen("../ws2a/bugs/lastbug","r"); - if(lastfilenum == NULL){ - printf("Error reteriveing bugs, contact the admin!"); - return 1; - } - long long last = 0; - fscanf(lastfilenum,"%lld",&last); - fclose(lastfilenum); - long long end = last-20; - - while(last > end && last > 0){ - char filestring[64] = "../ws2a/bugs/"; - char filename[10]; - sprintf(filename,"%lld",last); - strcat(filestring,filename); - FILE* thisbug; - thisbug = fopen(filestring,"r"); - if(thisbug == NULL){ - printf("Error opening bug:%s\n",filestring); - printf("
"); - last--; - continue; - } - printbug(thisbug); - printf("%lld\n",last); - fclose(thisbug); - last--; - } - - return 0; -} -/*Prints bugs, format: - Submitter\n - SubmitterID - Date_submitted\n - Short Description\n - Status\n - numcomments\n - bugid -*/ -void printbug(FILE* f){ - - int line = 0; - char tchar = ' '; - while((tchar = fgetc(f)) && tchar != EOF){ - if(tchar == '\n') - line++; - if(line > 4) - break; - putchar(tchar); - } - - unsigned int comments = 0; - while (EOF != (fscanf(f,"%*[^\n]"), fscanf(f,"%*c"))) - ++comments; - printf("\n%u\n",(comments-1)/4); -} - -/* -function htmlEscape(str) { - return String(str) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>') - .replace(/\//g, '/'); -} -*/ -- cgit v1.2.3-70-g09d2