🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nn
Article #209

PATCH #2 for 6.4 beta

#209
From: Kim F. Storm
Date: Tue, 20 Mar 1990 17:19
240 lines
7027 bytes
It has turned out that there are several bugs in the way the
time-stamp used to sort articles on the menus are calculated 
in 6.4 (related to the new handling of time zones).
Thanks to Paul Graham for spotting this bug (which - by pure
coincidence - did not show up here).

Unfortunately, the bugs caused the generated time-stamps to me much
too big, so after applying this patch, you will need to rebuild the
database (nnmaster -I) to get the proper timestamp on all articles.

Besides this, the following changes are made:

If HAVE_DIRECTORY is not defined, a faked set of directory routines
are used assuming that it is a system V compatible file system (14
char file names, 2 bytes for inode, etc).  This will allow most
systems without the directory routines to have the full benefits of
the file name completions.  If this does not work, the
NOT_SYS5_DIRECTORY symbol must be defined in the s- file to use the
old "non directory" code.  If this is true for any of the currently
supported systems, please tell me about it!

A bug in the option parser which caused the proposed startup of
nnmaster to fail (-l -r ...) has been fixed.

The default group of the :post command is now the current group even
when you only hit return (before you had to hit space+return).

This patch changes the version id to 6.4beta.2

++Kim Storm

*** /tst2/nn64/patchlevel.h	Tue Mar 20 18:16:17 1990
--- patchlevel.h	Tue Mar 20 18:16:53 1990
***************
*** 10,16 ****
   *	1989-09-08: Release 6.3.7	(FTP)
   *	1990-03-03: Release 6.4beta	(FTP)
   *	1990-03-18: BETA PATCH 1
   */
  
! #define PATCHLEVEL 1
  
--- 10,17 ----
   *	1989-09-08: Release 6.3.7	(FTP)
   *	1990-03-03: Release 6.4beta	(FTP)
   *	1990-03-18: BETA PATCH 1
+  *	1990-03-20: BETA PATCH 2
   */
  
! #define PATCHLEVEL 2
  
*** /tst2/nn64/answer.c	Fri Feb 23 20:30:02 1990
--- answer.c	Tue Mar 20 17:58:22 1990
***************
*** 353,359 ****
  
      str = get_s(current_group ? current_group->group_name : NONE, 
  		group_name, NONE, group_completion);
!     if (str == NULL || *str == NUL) return 0;
      strcpy(group_name, str);
  
      for (str = group_name; str; str = tail) {
--- 353,364 ----
  
      str = get_s(current_group ? current_group->group_name : NONE, 
  		group_name, NONE, group_completion);
!     if (str == NULL) return 0;
!     if (*str == NUL) {
! 	if (current_group == NULL || (current_group->group_flag & G_FAKED)) 
! 	    return 0;
! 	str = current_group->group_name;
!     }
      strcpy(group_name, str);
  
      for (str = group_name; str; str = tail) {
*** /tst2/nn64/folder.c	Sat Feb 10 02:31:30 1990
--- folder.c	Tue Mar 20 10:08:29 1990
***************
*** 9,14 ****
--- 9,19 ----
  #include "term.h"
  #include "menu.h"
  
+ /*
+  * if HAVE_DIRECTORY is not defined, traditional sysV directory structure
+  * is assumed unless NOT_SYS5_DIRECTORY is defined (in which case a
+  * shell command is used to list a directory)
+  */
  
  export int  dont_sort_folders = 0;
  export char *folder_directory  = NULL;
***************
*** 229,234 ****
--- 234,258 ----
  
  #ifndef HAVE_DIRECTORY
  
+ #ifndef NOT_SYS5_DIRECTORY
+ static struct dir_entry {
+     short int	d_ino;
+     char	d_name[15];
+ } dirbuf;
+ 
+ #define Direntry struct dir_entry
+ #define	DIR FILE
+ #define opendir(name)	fopen(name, "r")
+ #define readdir(dirp)	(fread(&dirbuf, 16, 1, dirp) == 1 ? &dirbuf : NULL)
+ #undef rewinddir
+ #define rewinddir(dirp)	rewind(dirp)
+ #define closedir(dirp)	fclose(dirp)
+ 
+ #define HAVE_DIRECTORY
+ #define FAKED_DIRECTORY
+ 
+ #else
+ 
  static FILE *dirf;
  static int prefix_lgt;
  
***************
*** 287,294 ****
  	pclose(dirf);
  	dirf = NULL;
      }
! }    
! #else /* HAVE_DIRECTORY */
  
  static string_marker str_mark;
  static char **completions = NULL;
--- 311,321 ----
  	pclose(dirf);
  	dirf = NULL;
      }
! }  
! #endif
! #endif
!   
! #ifdef HAVE_DIRECTORY
  
  static string_marker str_mark;
  static char **completions = NULL;
***************
*** 323,328 ****
--- 350,359 ----
  
      while ((dp = readdir(dirp)) != NULL) {
  	cp = dp->d_name;
+ #ifdef FAKED_DIRECTORY
+ 	if (dp->d_ino == 0) continue;
+ 	cp[14] = NUL;
+ #endif	
  	if (*cp == '.' && (cp[1] == '\0' || (cp[1] == '.' && cp[2] == '\0')))
  	    continue;
  	if (strncmp(prefix, cp, pflen) == 0)
*** /tst2/nn64/options.c	Sun Mar 26 01:36:13 1989
--- options.c	Mon Mar 19 10:03:25 1990
***************
*** 108,114 ****
  		ac--;
  	    }
  	    
! 	    if (od->option_type == 3 && *cp == '-') goto opt_str;
  	    
  	    *(od->option_address) = cp;
  	    
--- 108,117 ----
  		ac--;
  	    }
  	    
! 	    if (od->option_type == 3 && *cp == '-') {
! 		cp++;
! 		goto opt_str;
! 	    }
  	    
  	    *(od->option_address) = cp;
  	    
*** /tst2/nn64/pack_date.c	Sat Feb 10 01:57:42 1990
--- pack_date.c	Tue Mar 20 16:02:11 1990
***************
*** 20,26 ****
  char c;
  {
      if (c != 's') h--;		/* daylight savings */
!     return h*3600L+m*1800L;
  }
  
  static long etz(h, m, c)
--- 20,26 ----
  char c;
  {
      if (c != 's') h--;		/* daylight savings */
!     return h*60L+m*30L;
  }
  
  static long etz(h, m, c)
***************
*** 28,34 ****
  char c;
  {
      if (c == 's') h++;		/* summer time */
!     return -(h*3600L+m*1800L);
  }
    
  #define TOLOWER(ch) (isupper(ch) ? tolower(ch) : (ch))
--- 28,34 ----
  char c;
  {
      if (c == 's') h++;		/* summer time */
!     return -(h*60L+m*30L);
  }
    
  #define TOLOWER(ch) (isupper(ch) ? tolower(ch) : (ch))
***************
*** 39,44 ****
--- 39,47 ----
      char ch1, ch2, ch3, ch4;
      long tz, wtz(), etz();
  
+     while (*date && !isalpha(*date)) date++;
+     if (*date == NUL || *date == 'G') return 0;
+     
      ch1 = TOLOWER(*date);
      while (date++, (ch2 = TOLOWER(*date)) == '.')	/* p.s.t. -> pst */
  	;
***************
*** 86,91 ****
--- 89,96 ----
  	tz = etz(2,0,ch3); break;	/* Western European: wet, west */
       case 'y':
  	tz = wtz(9,0,ch2); break;	/* Yukon: yst, ydt */
+      default:
+ 	tz = 0; break;		/* use GMT if we can't understand it */
      }
  
      return tz;
-- 
Kim F. Storm        storm@texas.dk        Tel +45 429 174 00
Texas Instruments, Marielundvej 46E, DK-2730 Herlev, Denmark
	  No news is good news, but nn is better!
Technical Details
Message-ID: <489@texas.dk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!gmdzi!unido!mcsun!sunic!dkuug!tidk!storm

Show Full Headers
Complete Article Headers
Message-ID: <489@texas.dk>
Subject: PATCH #2 for 6.4 beta
Date: Tue, 20 Mar 1990 17:19:41 +0000
From: storm@texas.dk (Kim F. Storm)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!gmdzi!unido!mcsun!sunic!dkuug!tidk!storm
Newsgroups: news.software.nn
Distribution: news
Organization: Texas Instruments, Denmark
Lines: 240
Posted: Tue Mar 20 18:19:41 1990