"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "indexonly.c" between
sarg-2.3.11.tar.gz and sarg-2.4.0.tar.gz

About: SARG ia a Squid Analysis Report Generator.

indexonly.c  (sarg-2.3.11):indexonly.c  (sarg-2.4.0)
/* /*
* SARG Squid Analysis Report Generator http://sarg.sourceforge.net * SARG Squid Analysis Report Generator http://sarg.sourceforge.net
* 1998, 2013 * 1998, 2015
* *
* SARG donations: * SARG donations:
* please look at http://sarg.sourceforge.net/donations.php * please look at http://sarg.sourceforge.net/donations.php
* Support: * Support:
* http://sourceforge.net/projects/sarg/forums/forum/363374 * http://sourceforge.net/projects/sarg/forums/forum/363374
* --------------------------------------------------------------------- * ---------------------------------------------------------------------
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
skipping to change at line 37 skipping to change at line 37
#include "include/conf.h" #include "include/conf.h"
#include "include/defs.h" #include "include/defs.h"
void index_only(const char *dirname,int debug) void index_only(const char *dirname,int debug)
{ {
DIR *dirp; DIR *dirp;
struct dirent *direntp; struct dirent *direntp;
char remove[MAXLEN]; char remove[MAXLEN];
if ((dirp = opendir(dirname)) == NULL) { if ((dirp = opendir(dirname)) == NULL) {
debuga(_("Cannot open directory \"%s\": %s\n"),dirname,strerror(e rrno)); debuga(__FILE__,__LINE__,_("Cannot open directory \"%s\": %s\n"), dirname,strerror(errno));
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
while ( (direntp = readdir( dirp )) != NULL ){ while ( (direntp = readdir( dirp )) != NULL ){
if(strcmp(direntp->d_name,".") == 0 || strcmp(direntp->d_name,".. ") == 0 || strcmp(direntp->d_name, "index.html") == 0) if (strcmp(direntp->d_name,".") == 0 || strcmp(direntp->d_name,". .") == 0 || strcmp(direntp->d_name, INDEX_HTML_FILE) == 0)
continue; continue;
if (snprintf(remove,sizeof(remove),"%s/%s",dirname,direntp->d_nam e)>=sizeof(remove)) { if (snprintf(remove,sizeof(remove),"%s/%s",dirname,direntp->d_nam e)>=sizeof(remove)) {
debuga(_("Name of the file to remove is too long: %s/%s\n "),dirname,direntp->d_name); debuga(__FILE__,__LINE__,_("Name of the file to remove is too long. File name is \"%s/%s\"\n"),dirname,direntp->d_name);
continue; continue;
} }
if (unlink(remove) == -1) { if (unlink(remove) == -1) {
debuga(_("Cannot delete \"%s\": %s\n"),remove,strerror(er rno)); debuga(__FILE__,__LINE__,_("Cannot delete \"%s\": %s\n"), remove,strerror(errno));
} }
} }
(void)closedir( dirp ); (void)closedir( dirp );
return; return;
} }
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)