diff -dpr gophernicus-1.0//Makefile gophernicus-1.0-telefisk//Makefile
*** gophernicus-1.0//Makefile	Tue Oct  5 10:15:22 2010
--- gophernicus-1.0-telefisk//Makefile	Sat Oct  9 02:02:40 2010
***************
*** 8,14 ****
  NAME    = gophernicus
  PACKAGE = $(NAME)
  BINARY  = in.$(NAME)
! VERSION = 1.0
  
  SOURCES = $(NAME).c file.c menu.c string.c platform.c session.c
  HEADERS = functions.h files.h
--- 8,14 ----
  NAME    = gophernicus
  PACKAGE = $(NAME)
  BINARY  = in.$(NAME)
! VERSION = 1.0-telefisk
  
  SOURCES = $(NAME).c file.c menu.c string.c platform.c session.c
  HEADERS = functions.h files.h
diff -dpr gophernicus-1.0//file.c gophernicus-1.0-telefisk//file.c
*** gophernicus-1.0//file.c	Fri Oct  1 12:25:35 2010
--- gophernicus-1.0-telefisk//file.c	Sat Oct  9 02:02:40 2010
*************** void send_binary_file(state *st)
*** 34,45 ****
  	/* Faster sendfile() version */
  #ifdef HAVE_SENDFILE
  	int fd;
  	off_t offset = 0;
  
  	if (st->debug) syslog(LOG_INFO, "outputting binary file \"%s\"", st->req_realpath);
  
  	if ((fd = open(st->req_realpath, O_RDONLY)) == ERROR) return;
! 	sendfile(1, fd, &offset, st->req_filesize);
  	close(fd);
  
  	/* More compatible POSIX fread()/fwrite() version */
--- 34,46 ----
  	/* Faster sendfile() version */
  #ifdef HAVE_SENDFILE
  	int fd;
+ 	int bytes;
  	off_t offset = 0;
  
  	if (st->debug) syslog(LOG_INFO, "outputting binary file \"%s\"", st->req_realpath);
  
  	if ((fd = open(st->req_realpath, O_RDONLY)) == ERROR) return;
! 	bytes = sendfile(1, fd, &offset, st->req_filesize);
  	close(fd);
  
  	/* More compatible POSIX fread()/fwrite() version */
*************** void server_status(state *st, shm_state
*** 218,224 ****
  }
  #endif
  
! 
  /*
   * Handle /caps.txt
   */
--- 219,225 ----
  }
  #endif
  
! #ifndef KISS
  /*
   * Handle /caps.txt
   */
*************** void caps_txt(state *st, shm_state *shm)
*** 272,277 ****
--- 273,279 ----
  		printf("ServerDescription=%s" CRLF, st->server_description);
  }
  
+ #endif
  
  /*
   * Setup environment variables as per the CGI spec
Only in gophernicus-1.0/: functions.h
diff -dpr gophernicus-1.0//gophernicus.c gophernicus-1.0-telefisk//gophernicus.c
*** gophernicus-1.0//gophernicus.c	Fri Oct  1 12:22:48 2010
--- gophernicus-1.0-telefisk//gophernicus.c	Sat Oct  9 02:02:40 2010
*************** void log_combined(state *st, int status)
*** 176,184 ****
  	if (!*st->log_file) return;
  	if ((fp = fopen(st->log_file , "a")) == NULL) return;
  
- 	/* Format time */
  	now = time(NULL);
  	ltime = localtime(&now);
  	strftime(timestr, sizeof(timestr), HTTP_DATE, ltime);
  
  	/* Generate log entry */
--- 176,229 ----
  	if (!*st->log_file) return;
  	if ((fp = fopen(st->log_file , "a")) == NULL) return;
  
  	now = time(NULL);
  	ltime = localtime(&now);
+ 
+ #ifdef TELEFISK_LOGGIN
+ 	strftime(timestr,sizeof(timestr), "%a %B %d %H:%M:%S %Y",ltime);
+ 	if (status == HTTP_OK){
+ 	    if (strcmp(st->req_selector,ROOT) == MATCH) {
+ 			fprintf(fp , "%s %s : Root Connection\n",
+ 			timestr,
+ 			st->req_remote_addr);
+ 
+ 	    } else if (st->req_filetype == TYPE_MENU ) {
+ 		fprintf(fp , "%s %s : retrieved Directory %s%s\n",
+ 			timestr,
+ 			st->req_remote_addr,
+ 			st->server_host,
+ 			st->req_selector);
+ 	    } else if (st->req_filetype == TYPE_BINARY) {
+ 		fprintf(fp , "%s %s : send_binary File %s%s\n",
+ 			timestr,
+ 			st->req_remote_addr,
+ 			st->server_host,
+ 			st->req_selector);
+ 	    } else if (strstr(st->req_realpath, st->cgi_file) || st->req_filetype == TYPE_QUERY) {
+ 		fprintf(fp , "%s %s : executed cgi %s%s\n",
+ 			timestr,
+ 			st->req_remote_addr,
+ 			st->server_host,
+ 			st->req_selector);
+ 	    } else {
+ 		fprintf(fp , "%s %s : retrieved file %s%s\n",
+ 			timestr,
+ 			st->req_remote_addr,
+ 			st->server_host,
+ 			st->req_selector);
+ 
+ 	    }
+ 	} else {
+ 	    fprintf(fp , "%s %s : \"File or directory not found!\" %s%s\n",
+ 			timestr,
+ 			st->req_remote_addr,
+ 			st->server_host,
+ 			st->req_selector);
+ 	}
+ 
+ 	
+ #else
+ 	/* Format time */
  	strftime(timestr, sizeof(timestr), HTTP_DATE, ltime);
  
  	/* Generate log entry */
*************** void log_combined(state *st, int status)
*** 192,197 ****
--- 237,243 ----
  		status,
  		(long) st->req_filesize,
  		st->req_referrer);
+ #endif
  	fclose(fp);
  }
  
*************** void init_state(state *st)
*** 378,388 ****
  	st->session_max_hits = DEFAULT_SESSION_MAX_HITS;
  
  	/* Feature options */
! 	st->opt_vhost = TRUE;
! 	st->opt_parent = TRUE;
! 	st->opt_header = TRUE;
! 	st->opt_footer = TRUE;
! 	st->opt_date = TRUE;
  	st->opt_syslog = TRUE;
  	st->opt_magic = TRUE;
  	st->opt_iconv = TRUE;
--- 424,434 ----
  	st->session_max_hits = DEFAULT_SESSION_MAX_HITS;
  
  	/* Feature options */
! 	st->opt_vhost = FALSE;
! 	st->opt_parent = FALSE;
! 	st->opt_header = FALSE;
! 	st->opt_footer = FALSE;
! 	st->opt_date = FALSE;
  	st->opt_syslog = TRUE;
  	st->opt_magic = TRUE;
  	st->opt_iconv = TRUE;
*************** void parse_args(state *st, int argc, cha
*** 449,455 ****
  	int opt;
  
  	/* Parse args */
! 	while ((opt = getopt(argc, argv, "h:p:r:t:g:a:c:u:m:w:o:s:i:k:f:e:D:L:P:n:dl?-")) != ERROR) {
  		switch(opt) {
  			case 'h': sstrlcpy(st->server_host, optarg); break;
  			case 'p': st->server_port = atoi(optarg); break;
--- 495,501 ----
  	int opt;
  
  	/* Parse args */
! 	while ((opt = getopt(argc, argv, "h:p:r:t:g:a:c:u:L:w:o:s:i:k:f:e:D:l:P:n:dl?-")) != ERROR) {
  		switch(opt) {
  			case 'h': sstrlcpy(st->server_host, optarg); break;
  			case 'p': st->server_port = atoi(optarg); break;
*************** void parse_args(state *st, int argc, cha
*** 459,465 ****
  			case 'a': sstrlcpy(st->map_file, optarg); break;
  			case 'c': sstrlcpy(st->cgi_file, optarg); break;
  			case 'u': sstrlcpy(st->user_dir, optarg);  break;
! 			case 'm': sstrlcpy(st->log_file, optarg);  break;
  
  			case 'w': st->out_width = atoi(optarg); break;
  			case 'o': sstrlcpy(st->out_charset, optarg);  break;
--- 505,511 ----
  			case 'a': sstrlcpy(st->map_file, optarg); break;
  			case 'c': sstrlcpy(st->cgi_file, optarg); break;
  			case 'u': sstrlcpy(st->user_dir, optarg);  break;
! 			case 'L': sstrlcpy(st->log_file, optarg);  break;
  
  			case 'w': st->out_width = atoi(optarg); break;
  			case 'o': sstrlcpy(st->out_charset, optarg);  break;
*************** int main(int argc, char *argv[])
*** 638,644 ****
  		return OK;
  	}
  #endif
! 
  	/* Redirect HTTP requests to a gopher proxy */
  	if (sstrncmp(buf + 1, "GET ") == MATCH) {
  		if (st.debug) syslog(LOG_INFO, "got http request, redirecting to proxy");
--- 684,690 ----
  		return OK;
  	}
  #endif
! #ifndef KISS
  	/* Redirect HTTP requests to a gopher proxy */
  	if (sstrncmp(buf + 1, "GET ") == MATCH) {
  		if (st.debug) syslog(LOG_INFO, "got http request, redirecting to proxy");
*************** int main(int argc, char *argv[])
*** 651,657 ****
  		printf("Server: " SERVER_SOFTWARE_FULL CRLF CRLF, st.server_platform);
  		return OK;
  	}
! 
  	/* Save default server_host & fetch session data (including new server_host) */
  	sstrlcpy(st.server_host_default, st.server_host);
  #ifdef HAVE_SHMEM
--- 697,703 ----
  		printf("Server: " SERVER_SOFTWARE_FULL CRLF CRLF, st.server_platform);
  		return OK;
  	}
! #endif
  	/* Save default server_host & fetch session data (including new server_host) */
  	sstrlcpy(st.server_host_default, st.server_host);
  #ifdef HAVE_SHMEM
*************** int main(int argc, char *argv[])
*** 700,711 ****
  	}
  #endif
  
  	/* Handle /caps.txt requests */
  	if (sstrncmp(st.req_selector, CAPS_TXT) == MATCH) {
  		caps_txt(&st, shm);
  		return OK;
  	}
! 
  	/* Remove possible extra cruft from server_host */
  	if ((c = strchr(st.server_host, '\t'))) *c = '\0';
  
--- 746,758 ----
  	}
  #endif
  
+ #ifndef KISS
  	/* Handle /caps.txt requests */
  	if (sstrncmp(st.req_selector, CAPS_TXT) == MATCH) {
  		caps_txt(&st, shm);
  		return OK;
  	}
! #endif
  	/* Remove possible extra cruft from server_host */
  	if ((c = strchr(st.server_host, '\t'))) *c = '\0';
  
diff -dpr gophernicus-1.0//gophernicus.h gophernicus-1.0-telefisk//gophernicus.h
*** gophernicus-1.0//gophernicus.h	Tue Oct  5 09:49:54 2010
--- gophernicus-1.0-telefisk//gophernicus.h	Sat Oct  9 02:22:54 2010
***************
*** 29,37 ****
  /*
   * Features
   */
! #undef  ENABLE_STRICT_RFC1436	/* Follow RFC1436 to the letter */
! #undef  ENABLE_AUTOHIDING	/* Hide manually listed resources from generated menus*/
! 
  
  /*
   * Platform configuration
--- 29,39 ----
  /*
   * Features
   */
! #define  ENABLE_STRICT_RFC1436	/* Follow RFC1436 to the letter */
! #define  ENABLE_AUTOHIDING	/* Hide manually listed resources from generated menus*/
! #define  KISS			/* Keep it simple stupid, removes certain features like caps special case
! 				   and proxy forwarding */
! #define	TELEFISK_LOGGIN
  
  /*
   * Platform configuration
*************** typedef struct {
*** 335,342 ****
  	"html","h","htm","h","xhtml","h","css","h","swf","h","rdf","h","rss","h","xml","h", \
  	"jpg","I","jpeg","I","png","I","bmp","I","svg","I","tif","I","tiff","I", \
  	"ico","I","xbm","I","xpm","I","pcx","I", \
! 	"mbox","M", \
! 	"pdf","p","ps","p", \
  	"mp3","s","wav","s","mid","s","wma","s","flac","s","ogg","s","aiff","s","aac","s", \
  	"avi",";","mp4",";","mpg",";","mov",";","qt",";","asf",";","mpv",";", \
  	NULL, NULL
--- 337,344 ----
  	"html","h","htm","h","xhtml","h","css","h","swf","h","rdf","h","rss","h","xml","h", \
  	"jpg","I","jpeg","I","png","I","bmp","I","svg","I","tif","I","tiff","I", \
  	"ico","I","xbm","I","xpm","I","pcx","I", \
! 	"mbox","1", \
! 	"pdf","9","ps","9", \
  	"mp3","s","wav","s","mid","s","wma","s","flac","s","ogg","s","aiff","s","aac","s", \
  	"avi",";","mp4",";","mpg",";","mov",";","qt",";","asf",";","mpv",";", \
  	NULL, NULL
diff -dpr gophernicus-1.0//menu.c gophernicus-1.0-telefisk//menu.c
*** gophernicus-1.0//menu.c	Tue Oct  5 09:47:59 2010
--- gophernicus-1.0-telefisk//menu.c	Sat Oct  9 02:01:54 2010
*************** int gophermap(state *st, char *mapfile,
*** 363,370 ****
  
  			printf("%c%s\t%s\t%s\t%i" CRLF, type, name,
  				selector, host, port);
  		}
- 
  		/* Handle relative resources */
  		else {
  			printf("%c%s\t%s%s\t%s\t%i" CRLF, type, name,
--- 363,373 ----
  
  			printf("%c%s\t%s\t%s\t%i" CRLF, type, name,
  				selector, host, port);
+ #ifdef ENABLE_AUTOHIDING
+ 			if (st->hidden_count < MAX_HIDDEN)
+ 				sstrlcpy(st->hidden[st->hidden_count++], (++selector));
+ #endif
  		}
  		/* Handle relative resources */
  		else {
  			printf("%c%s\t%s%s\t%s\t%i" CRLF, type, name,
*************** int gophermap(state *st, char *mapfile,
*** 372,379 ****
--- 375,391 ----
  
  			/* Automatically hide manually defined selectors */
  #ifdef ENABLE_AUTOHIDING
+ 		if ( selector[0] == '.' ) {
+ 		/* add 2 to get pass ./ */
+ 			selector=selector+2;
+ 		/* add any defined selectors  to the hid list so they aint shown by gopher_menu() later on */
  			if (st->hidden_count < MAX_HIDDEN)
  				sstrlcpy(st->hidden[st->hidden_count++], selector);
+ 			} else {
+ 		/* add any defined selectors  to the hid list so they aint shown by gopher_menu() later on */
+ 			    if (st->hidden_count < MAX_HIDDEN)
+                 		sstrlcpy(st->hidden[st->hidden_count++], selector);
+ 			    }
  #endif
  		}
  	}
