Subject: Cygnus Win32 B17.1: Port of Cyclic Software CVS 1.9
From: [email-masked] ("Griswold, Victor")

27 Feb 1997 19:55:21 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <c=US%a=_%p=TELXON%l=TELXON/TLXUSEX1/[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Original-To: "'Cygnus:GNU-WIN32'" <[email-masked]>,
        "[email-masked]'"
	 <[email-masked]>
X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63
Original-Sender: [email-masked]

Gentlemen:

The following are diffs against the Cyclic Software CVS 1.9 distribution
for building CVS 1.9 under Cygnus GNU-Win32.  This build of CVS has been
fully checked against a (highly) modified version of 'CVS sanity'.
Both text and binary files work correctly (though there is no warranty,
of course ;-) ).  All non-server, non-client portions of "CVS sanity"
pass
their tests; client and server modes are untested.  This port of CVS 1.9
makes use of the my port of RCS 5.7, posted on 2/25/97.

Pardons for posting the diffs here; I have no anonymous FTP site
available.

Apply the diffs below for 'config.h' _after_ 'configure' is run.  I have
not had the opportunity to modify the configure script itself.

Until cygwin32 handles WinNT groups better, you need to comment-out 
'#define CVS_ADMIN_GROUP "cvsadmin"' in 'src/options.h'.

The same "text vs. binary" file handling paradigm as was used for the
RCS
port was used for CVS.  In short, all repositories are in "Unix-normal"
form, but non-specifically-binary files are converted from and to the
host's "native" text-file format.  This allows one set of repositories
to be utilized by both Unix and MS-Windows hosts.

Much, but my no means most, of the port was done by incorporating
portions
of the files under 'windows-NT' into the main files under 'src'.
Actually,
given cygwin32, much of the 'windows-NT' directory is no longer needed.

There are more than just WinNT-specific modifications below.  There are
several bug fixes to CVS 1.9 itself.  I have no time remaining on this
effort to sort out each and every one, however.  Some of them are:
	Corrected several binary-file handling problems.
	Corrected (I believe) dead-file handling bugs in 'diff.c'.
	Added more 'trace' diagnostics.
	Fixed a bug in processing of long ignore lists after resetting the
list.
	Made 'import' insensitive to directory activity during import.  This
	        was essential for correct operation of wrappers under
MS-Windows.
	Fixed other wrapper-related bugs in 'import'.
	Modified import so that '-k' options present in an explicit wrapper
	        have priority over a '-k' option applied to a directory on the
	        command line.  This appeared more useful and intuitive.
	Added the Users file to the default administrative file database.
	Fixed 'cvs release -d'.

In order to better understand the CVS source, I did run portions of the
source through 'indent'.  I have tried to remove most of such
"unnecessary
diffs" from the diffs below, but there are a few left.  Apologies to the
CVS maintainers.

Some of the WinNT-specific modifications:
	Ability to handle MS-Windows case-insensitive filenames.
	Ability to handle "/dev/null" under MS-Windows.
	Better ability to find out the user name.
	Tolerance for '\r' if found in a repository line.

As with RCS, 'blat' version 1.5i has been used to send notifications.
Change the last line of "<repository>/CVSROOT/notify" to:

ALL blat - -t %s -s "CVS notification"

About 'sanity.sh':  no diffs for the modified version are posted here,
because they are far too long.  Some of the diffs include "NUL" instead
of
"/dev/null", checking for user names which can include capitals,
different
ordering of files from 'readdir', compensating for the
case-insensitivity
of file and directory names, etc.  If anyone wants the modified
'sanity.sh',
I will mail it directly to them.

I was unable to execute 'sanity.sh' correctly under Win95, only under
WinNT 3.51sp{3,5} and WinNT4.0sp2.  This appeared due to 'bash'
problems,
however, not CVS or RCS problems.  Use CVS/RCS under Win95 at your own
risk!

The biggest difference with 'sanity.sh', however, is the apparent
non-determinism of the NT filesystem.  File operations which "just took
place" were sometimes "missed" by the validation script.  I had to
insert
'sleep' commands or 'NTsync' commands between some operations so that
the
following test operation would get the correct results.

Yes, this was quite unnerving, though no problems have been encountered
with
CVS by our group under actual working conditions.  Remember that
'sanity.sh'
works on operations so short and small that multiple operations can take
place within the granularity of a FAT or NTFS filesystem timestamp
quantum.

--- On soapbox --------

*** Insert standard comments about WinNT not being a real operating
system
*** at least until Microsoft can develop a stable filesystem driver.
This
*** should warn people about the danger of relying on WinNT as a file
server
*** for serious development work.  Yes, I did re-route 'sanity.sh' to
use
*** our WinNT file server as the test directory, and had the same non-
*** deterministic results.

Yes, I know of and have experienced the oddities of Sun NFS.  They are
far
less disturbing to me than the problems I have experienced under WinNT.

But I am one of those poor souls forced to rely on WinNT as both a
development platform and as a file server.  I want my Sun back... :-(

--- Off soapbox --------

Now, if someone will just port tkcvs to WinNT/Cygwin32...

Victor J. Griswold, D.Sc.
Aironet Wireless Communications, Inc.
voice:	330-664-7987
fax:	330-664-7301
email:	(MS-Mail) [email-masked]
	(MIME) [email-masked]

Index: CVS_src/lib/strippath.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/lib/strippath.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 strippath.c
*** strippath.c	1997/01/15 16:27:10	1.1.1.1
--- strippath.c	1997/02/19 15:50:21
***************
*** 19,24 ****
--- 19,26 ----
  #include "config.h"
  #endif
  
+ #if !defined(_WIN32)
+ 
  #if STDC_HEADERS || HAVE_STRING_H
  #include <string.h>
  /* An ANSI string.h and pre-ANSI memory.h might conflict. */
***************
*** 66,71 ****
--- 68,110 ----
      }
    strip_trailing_slashes(path);
  }
+ 
+ #else	/* !defined(_WIN32) */
+ 
+ #include <string.h>
+ 
+ static void remove_component(char *beginc, char *endc);
+ void strip_trailing_slashes(char *path);
+ 
+ /* Remove unnecessary components from PATH. */
+ 
+ void
+ strip_path (path)
+      char *path;
+ {
+   int stripped = 0;
+   char *cp, *slash;
+ 
+   for (cp = path; *(slash = cp + strcspn (cp, "/\\")) != '\0'; cp =
slash)
+     {
+       *slash = '\0';
+       if ((!*cp && (cp != path || stripped)) ||
+ 	  strcmp(cp, ".") == 0 || strcmp(cp, "/") == 0)
+ 	{
+ 	  stripped = 1;
+ 	  remove_component(cp, slash);
+ 	  slash = cp;
+ 	}
+       else
+ 	{
+ 	  *slash++ = '/';
+ 	}
+     }
+   strip_trailing_slashes(path);
+ }
+ 
+ #endif	/* !defined(_WIN32) */
+ 
  
  /* Remove the component delimited by BEGINC and ENDC from the path */
  
Index: CVS_src/lib/stripslash.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/lib/stripslash.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 stripslash.c
*** stripslash.c	1997/01/15 16:27:10	1.1.1.1
--- stripslash.c	1997/02/19 15:50:21
***************
*** 19,24 ****
--- 19,26 ----
  #include "config.h"
  #endif
  
+ #if !defined(_WIN32)
+ 
  #if STDC_HEADERS || HAVE_STRING_H
  #include <string.h>
  /* An ANSI string.h and pre-ANSI memory.h might conflict. */
***************
*** 42,44 ****
--- 44,65 ----
    while (last > 0 && path[last] == '/')
      path[last--] = '\0';
  }
+ 
+ #else	/* !defined(_WIN32) */
+ 
+ #include <string.h>
+ 
+ /* Remove trailing slashes from PATH. */
+ 
+ void
+ strip_trailing_slashes (path)
+      char *path;
+ {
+   int last;
+ 
+   last = strlen (path) - 1;
+   while (last > 0 && (path[last] == '/' || path[last] == '\\'))
+     path[last--] = '\0';
+ }
+ 
+ #endif	/* !defined(_WIN32) */
Index: CVS_src/lib/system.h
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/lib/system.h,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 system.h
*** system.h	1997/01/15 16:27:11	1.1.1.1
--- system.h	1997/02/25 15:53:19
***************
*** 506,513 ****
--- 506,525 ----
  #define OPEN_BINARY (O_BINARY)
  #define FOPEN_BINARY_READ ("rb")
  #define FOPEN_BINARY_WRITE ("wb")
+ #define FOPEN_BINARY_UPDATE ("w+b")
+ #define FOPEN_BINARY_APPEND ("ab")
  #else
  #define OPEN_BINARY (0)
  #define FOPEN_BINARY_READ ("r")
  #define FOPEN_BINARY_WRITE ("w")
+ #define FOPEN_BINARY_UPDATE ("w+")
+ #define FOPEN_BINARY_APPEND ("a")
  #endif
+ 
+ #if !defined(FILENAMES_CASE_INSENSITIVE) ||
(FILENAMES_CASE_INSENSITIVE == 0)
+ #define FN_STRCMP strcmp
+ #define FN_STRNCMP strncmp
+ #else	/* !defined(FILENAMES_CASE_INSENSITIVE) ||
(FILENAMES_CASE_INSENSITIVE == 0) */
+ #define FN_STRCMP strcasecmp
+ #define FN_STRNCMP strncasecmp
+ #endif	/* !defined(FILENAMES_CASE_INSENSITIVE) ||
(FILENAMES_CASE_INSENSITIVE == 0) */
Index: CVS_src/src/add.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/add.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 add.c
*** add.c	1997/01/15 16:27:17	1.1.1.1
--- add.c	1997/02/20 15:30:15
***************
*** 405,411 ****
  	       "directory %s not added; must be a direct sub-directory",
dir);
  	return (1);
      }
!     if (strcmp (dir, CVSADM) == 0)
      {
  	error (0, 0, "cannot add a `%s' directory", CVSADM);
  	return (1);
--- 405,411 ----
  	       "directory %s not added; must be a direct sub-directory",
dir);
  	return (1);
      }
!     if (FN_STRCMP (dir, CVSADM) == 0)
      {
  	error (0, 0, "cannot add a `%s' directory", CVSADM);
  	return (1);
Index: CVS_src/src/checkout.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/checkout.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 checkout.c
*** checkout.c	1997/01/15 16:27:17	1.1.1.1
--- checkout.c	1997/02/20 15:30:13
***************
*** 449,455 ****
      }
      getwd (current);
      hardpath_len = strlen (hardpath);
!     if (strncmp (current, hardpath, hardpath_len) == 0)
      {
  	if (/* Current is a subdirectory of hardpath.  */
  	    current[hardpath_len] == '/'
--- 449,455 ----
      }
      getwd (current);
      hardpath_len = strlen (hardpath);
!     if (FN_STRNCMP (current, hardpath, hardpath_len) == 0)
      {
  	if (/* Current is a subdirectory of hardpath.  */
  	    current[hardpath_len] == '/'
Index: CVS_src/src/client.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/client.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 client.c
*** client.c	1997/01/15 16:27:17	1.1.1.1
--- client.c	1997/02/20 15:30:13
***************
*** 739,745 ****
      const char *retval;
      if (use_directory)
  	return (char *) name;
!     if (strncmp (name, toplevel_repos, strlen (toplevel_repos)) != 0)
  	error (1, 0, "server bug: name `%s' doesn't specify file in `%s'",
  	       name, toplevel_repos);
      retval = name + strlen (toplevel_repos) + 1;
--- 739,745 ----
      const char *retval;
      if (use_directory)
  	return (char *) name;
!     if (FN_STRNCMP (name, toplevel_repos, strlen (toplevel_repos)) !=
0)
  	error (1, 0, "server bug: name `%s' doesn't specify file in `%s'",
  	       name, toplevel_repos);
      retval = name + strlen (toplevel_repos) + 1;
***************
*** 806,812 ****
      reposdirname_absolute = 0;
      if (reposname != NULL)
      {
! 	if (strncmp (reposname, toplevel_repos, strlen (toplevel_repos)) !=
0)
  	{
  	    reposdirname_absolute = 1;
  	    short_repos = reposname;
--- 806,812 ----
      reposdirname_absolute = 0;
      if (reposname != NULL)
      {
! 	if (FN_STRNCMP (reposname, toplevel_repos, strlen (toplevel_repos))
!= 0)
  	{
  	    reposdirname_absolute = 1;
  	    short_repos = reposname;
***************
*** 863,869 ****
      }
  
      if (last_dir_name == NULL
! 	|| strcmp (last_dir_name, dir_name) != 0)
      {
  	int newdir;
  
--- 863,869 ----
      }
  
      if (last_dir_name == NULL
! 	|| FN_STRCMP (last_dir_name, dir_name) != 0)
      {
  	int newdir;
  
***************
*** 1591,1597 ****
  	    {
  	        run_setup ("%s -f -s -b ~ %s %s", PATCH_PROGRAM,
  			   filename, temp_filename);
! 		retcode = run_exec (DEVNULL, RUN_TTY, RUN_TTY, RUN_NORMAL);
  	    }
  	    /* FIXME: should we really be silently ignoring errors?  */
  	    (void) unlink_file (temp_filename);
--- 1591,1597 ----
  	    {
  	        run_setup ("%s -f -s -b ~ %s %s", PATCH_PROGRAM,
  			   filename, temp_filename);
! 		retcode = run_exec (DEVNULL_IN, RUN_TTY, RUN_TTY, RUN_NORMAL);
  	    }
  	    /* FIXME: should we really be silently ignoring errors?  */
  	    (void) unlink_file (temp_filename);
***************
*** 1888,1899 ****
  {
      char *short_pathname;
  
!     if (strcmp (toplevel_repos, CVSroot_directory) != 0)
  	return 0;
  
      if (!use_directory)
      {
! 	if (strncmp (pathname, CVSroot_directory, strlen (CVSroot_directory))
!= 0)
  	    error (1, 0,
  		   "server bug: pathname `%s' doesn't specify file in `%s'",
  		   pathname, CVSroot_directory);
--- 1888,1899 ----
  {
      char *short_pathname;
  
!     if (FN_STRCMP (toplevel_repos, CVSroot_directory) != 0)
  	return 0;
  
      if (!use_directory)
      {
! 	if (FN_STRNCMP (pathname, CVSroot_directory, strlen
(CVSroot_directory)) != 0)
  	    error (1, 0,
  		   "server bug: pathname `%s' doesn't specify file in `%s'",
  		   pathname, CVSroot_directory);
***************
*** 2192,2198 ****
      errno = 0;
      while ((dp = readdir (dirp)) != NULL)
      {
! 	if (strcmp (dp->d_name, ".") != 0 && strcmp (dp->d_name, "..") != 0
&&
  	    strcmp (dp->d_name, CVSADM) != 0)
  	{
  	    (void) closedir (dirp);
--- 2192,2199 ----
      errno = 0;
      while ((dp = readdir (dirp)) != NULL)
      {
! 	if (strlen(dp->d_name) != 0 &&	/* bypass cygwin.dll rel. b17 bug */
! 		strcmp (dp->d_name, ".") != 0 && strcmp (dp->d_name, "..") != 0 &&
  	    strcmp (dp->d_name, CVSADM) != 0)
  	{
  	    (void) closedir (dirp);
***************
*** 4589,4595 ****
      if (first_time)
  	send_a_repository ("", repository, "");
  
!     if (strncmp (repository, toplevel_repos, strlen (toplevel_repos))
!= 0)
  	error (1, 0,
  	       "internal error: pathname `%s' doesn't specify file in `%s'",
  	       repository, toplevel_repos);
--- 4590,4596 ----
      if (first_time)
  	send_a_repository ("", repository, "");
  
!     if (FN_STRNCMP (repository, toplevel_repos, strlen
(toplevel_repos)) != 0)
  	error (1, 0,
  	       "internal error: pathname `%s' doesn't specify file in `%s'",
  	       repository, toplevel_repos);
***************
*** 4649,4655 ****
  	goto error_exit;
      }
      *cp = '\0';
!     if (strcmp (filename, line + 1) != 0)
      {
  	error (0, 0, "protocol error: notified %s, expected %s", filename,
  	       line + 1);
--- 4650,4656 ----
  	goto error_exit;
      }
      *cp = '\0';
!     if (FN_STRCMP (filename, line + 1) != 0)
      {
  	error (0, 0, "protocol error: notified %s, expected %s", filename,
  	       line + 1);
Index: CVS_src/src/commit.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/commit.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 commit.c
*** commit.c	1997/01/15 16:27:17	1.1.1.1
--- commit.c	1997/02/20 15:30:15
***************
*** 1206,1218 ****
      {
  	char *p;
  
! 	if (strncmp (CVSroot_directory, repository,
  		     strlen (CVSroot_directory)) != 0)
  	    error (0, 0, "internal error: repository (%s) doesn't begin with
root (%s)", repository, CVSroot_directory);
  	p = repository + strlen (CVSroot_directory);
  	if (*p == '/')
  	    ++p;
! 	if (strcmp ("CVSROOT", p) == 0)
  	{
  	    /* "Database" might a little bit grandiose and/or vague,
  	       but "checked-out copies of administrative files, unless
--- 1206,1218 ----
      {
  	char *p;
  
! 	if (FN_STRNCMP (CVSroot_directory, repository,
  		     strlen (CVSroot_directory)) != 0)
  	    error (0, 0, "internal error: repository (%s) doesn't begin with
root (%s)", repository, CVSroot_directory);
  	p = repository + strlen (CVSroot_directory);
  	if (*p == '/')
  	    ++p;
! 	if (FN_STRCMP ("CVSROOT", p) == 0)
  	{
  	    /* "Database" might a little bit grandiose and/or vague,
  	       but "checked-out copies of administrative files, unless
***************
*** 1242,1252 ****
  	    line = NULL;
  	    line_chars_allocated = 0;
  	    line_length = getline (&line, &line_chars_allocated, fp);
! 	    if (line_length > 0)
! 	    {
  		/* Remove any trailing newline.  */
! 		if (line[line_length - 1] == '\n')
  		    line[--line_length] = '\0';
  		repository = Name_Repository ((char *) NULL, update_dir);
  		run_setup ("%s %s", line, repository);
  		(void) printf ("%s %s: Executing '", program_name,
--- 1242,1257 ----
  	    line = NULL;
  	    line_chars_allocated = 0;
  	    line_length = getline (&line, &line_chars_allocated, fp);
! 	    if (line_length > 0) {
  			/* Remove any trailing newline.  */
! 			if (line[line_length - 1] == '\n') {
! 			    line[--line_length] = '\0';
! 
! 				/*	For DOS targets, remove any CR, as well.	*/
! 				if (line[line_length - 1] == '\r')
  				    line[--line_length] = '\0';
+ 			}
+ 
  			repository = Name_Repository ((char *) NULL, update_dir);
  			run_setup ("%s %s", line, repository);
  			(void) printf ("%s %s: Executing '", program_name,
***************
*** 1696,1702 ****
  	    strcpy (oldfile, rcs);
  	    sprintf (rcs, "%s/%s%s", repository, file, RCSEXT);
  	    
! 	    if (strcmp (oldfile, rcs) == 0
  		|| CVS_RENAME (oldfile, rcs) != 0
  		|| isreadable (oldfile)
  		|| !isreadable (rcs))
--- 1701,1707 ----
  	    strcpy (oldfile, rcs);
  	    sprintf (rcs, "%s/%s%s", repository, file, RCSEXT);
  	    
! 	    if (FN_STRCMP (oldfile, rcs) == 0
  		|| CVS_RENAME (oldfile, rcs) != 0
  		|| isreadable (oldfile)
  		|| !isreadable (rcs))
***************
*** 1751,1757 ****
  	/* move the new file out of the way. */
  	(void) sprintf (fname, "%s/%s%s", CVSADM, CVSPREFIX, file);
  	rename_file (file, fname);
! 	copy_file (DEVNULL, file);
  
  	tmp = xmalloc (strlen (file) + strlen (tag) + 80);
  	/* commit a dead revision. */
--- 1756,1762 ----
  	/* move the new file out of the way. */
  	(void) sprintf (fname, "%s/%s%s", CVSADM, CVSPREFIX, file);
  	rename_file (file, fname);
! 	copy_file (DEVNULL_IN, file);
  
  	tmp = xmalloc (strlen (file) + strlen (tag) + 80);
  	/* commit a dead revision. */
Index: CVS_src/src/create_adm.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/create_adm.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 create_adm.c
*** create_adm.c	1997/01/15 16:27:18	1.1.1.1
--- create_adm.c	1997/02/20 15:30:15
***************
*** 58,64 ****
  	(void) sprintf (tmp, "%s/%s", dir, CVSADM_REP);
      else
  	(void) strcpy (tmp, CVSADM_REP);
!     fout = CVS_FOPEN (tmp, "w+");
      if (fout == NULL)
      {
  	if (update_dir[0] == '\0')
--- 58,64 ----
  	(void) sprintf (tmp, "%s/%s", dir, CVSADM_REP);
      else
  	(void) strcpy (tmp, CVSADM_REP);
!     fout = CVS_FOPEN (tmp, FOPEN_BINARY_UPDATE);
      if (fout == NULL)
      {
  	if (update_dir[0] == '\0')
***************
*** 79,85 ****
  	char path[PATH_MAX];
  
  	(void) sprintf (path, "%s/", CVSroot_directory);
! 	if (strncmp (repository, path, strlen (path)) == 0)
  	    cp = repository + strlen (path);
      }
  #endif
--- 79,85 ----
  	char path[PATH_MAX];
  
  	(void) sprintf (path, "%s/", CVSroot_directory);
! 	if (FN_STRNCMP (repository, path, strlen (path)) == 0)
  	    cp = repository + strlen (path);
      }
  #endif
***************
*** 104,110 ****
  	(void) sprintf (tmp, "%s/%s", dir, CVSADM_ENT);
      else
  	(void) strcpy (tmp, CVSADM_ENT);
!     fout = CVS_FOPEN (tmp, "w+");
      if (fout == NULL)
      {
  	if (update_dir[0] == '\0')
--- 104,110 ----
  	(void) sprintf (tmp, "%s/%s", dir, CVSADM_ENT);
      else
  	(void) strcpy (tmp, CVSADM_ENT);
!     fout = CVS_FOPEN (tmp, FOPEN_BINARY_UPDATE);
      if (fout == NULL)
      {
  	if (update_dir[0] == '\0')
Index: CVS_src/src/cvs.h
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/cvs.h,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 cvs.h
*** cvs.h	1997/01/15 16:27:16	1.1.1.1
--- cvs.h	1997/02/19 15:50:29
***************
*** 207,216 ****
--- 207,220 ----
  #ifdef USE_VMS_FILENAMES
  #define BAKPREFIX       "_$"
  #define DEVNULL         "NLA0:"
+ #define DEVNULL_IN	DEVNULL
+ #define DEVNULL_OUT	DEVNULL
  #else /* USE_VMS_FILENAMES */
  #define	BAKPREFIX	".#"		/* when rcsmerge'ing */
  #ifndef DEVNULL
  #define	DEVNULL		"/dev/null"
+ #define DEVNULL_IN	DEVNULL
+ #define DEVNULL_OUT	DEVNULL
  #endif
  #endif /* USE_VMS_FILENAMES */
  
Index: CVS_src/src/diff.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/diff.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 diff.c
*** diff.c	1997/01/15 16:27:18	1.1.1.1
--- diff.c	1997/02/19 15:50:29
***************
*** 329,340 ****
--- 329,347 ----
      char *tmp;
      char *tocvsPath;
      char fname[PATH_MAX];
+ 	const char *process_binary;
  
  #ifdef SERVER_SUPPORT
      user_file_rev = 0;
  #endif
      vers = Version_TS (finfo, NULL, NULL, NULL, 1, 0);
  
+ #if defined(_WIN32)
+ 	if (strcmp(vers->options, "-kb") == 0) {
+ 		process_binary = "--binary";
+ 	} else
+ #endif	/* defined(_WIN32) */
+		   {
+ 		process_binary = "";
+ 	}
+ 
      if (diff_rev2 != NULL || diff_date2 != NULL)
      {
  	/* Skip all the following checks regarding the user file; we're
***************
*** 441,453 ****
      }
  
      empty_file = diff_file_nodiff (finfo, vers, empty_file);
!     if (empty_file == DIFF_SAME || empty_file == DIFF_ERROR)
!     {
  	freevers_ts (&vers);
- 	if (empty_file == DIFF_SAME)
  	    return (0);
! 	else
! 	{
  	    diff_mark_errors (err);
  	    return (err);
  	}
--- 448,482 ----
      }
  
      empty_file = diff_file_nodiff (finfo, vers, empty_file);
!     if (empty_file == DIFF_SAME || empty_file == DIFF_ERROR) {
! 		if (empty_file == DIFF_SAME) {
! 			if (use_rev1 != NULL) {
! 			    int dead1 = RCS_isdead (vers->srcfile, use_rev1);
! 
! 				if (dead1) {
! 					if (trace)
! 						(void) fprintf(stderr, "-> diff_fileproc: revision %s is
dead\n",use_rev1);
! 
! 					/*	Treat new files as empty?	*/
! 				    if (empty_files)
! 				        empty_file = DIFF_ADDED;
! 				    else {
! 						error (0, 0, "%s is a new entry, no comparison available",
! 						       finfo->fullname);
! 						freevers_ts (&vers);
! 						diff_mark_errors (err);
! 						return (err);
! 				    }
! 				} else {
  					freevers_ts (&vers);
  				    return (0);
! 				}
!    			} else {
! 				freevers_ts (&vers);
! 			    return (0);
! 			}
! 		} else {
! 			freevers_ts (&vers);
  		    diff_mark_errors (err);
  		    return (err);
  		}
***************
*** 473,478 ****
--- 502,510 ----
  	}
  	else if (dead1)
  	{
+ 		if (trace)
+ 			(void) fprintf(stderr, "-> diff_fileproc: revision %s is
dead\n",use_rev1);
+ 
  	    if (empty_files)
  	        empty_file = DIFF_ADDED;
  	    else
***************
*** 528,534 ****
  	if (empty_file == DIFF_ADDED)
  	{
  	    if (use_rev2 == NULL)
! 		run_setup ("%s %s %s %s", DIFF, opts, DEVNULL, finfo->file);
  	    else
  	    {
  		int retcode;
--- 560,566 ----
  	if (empty_file == DIFF_ADDED)
  	{
  	    if (use_rev2 == NULL)
! 		run_setup ("%s %s %s %s %s", DIFF, process_binary, opts, DEVNULL_IN,
finfo->file);
  	    else
  	    {
  		int retcode;
***************
*** 540,545 ****
--- 572,581 ----
  					 ? options
  					 : vers->options),
  					tmp);
+ 
+ 		if (trace)
+ 			(void) fprintf(stderr, "-> diff_fileproc: (empty_file ==
DIFF_ADDED) RCS_checkout of rev %s returned %d\n",use_rev2,retcode);
+ 
  		if (retcode == -1)
  		{
  		    (void) CVS_UNLINK (tmp);
***************
*** 548,554 ****
  		}
  		/* FIXME: what if retcode > 0?  */
  
! 		run_setup ("%s %s %s %s", DIFF, opts, DEVNULL, tmp);
  	    }
  	}
  	else
--- 584,590 ----
  		}
  		/* FIXME: what if retcode > 0?  */
  
! 		run_setup ("%s %s %s %s %s", DIFF, process_binary, opts, DEVNULL_IN,
tmp);
  	    }
  	}
  	else
***************
*** 560,565 ****
--- 596,604 ----
  				    use_rev1, (char *) NULL,
  				    *options ? options : vers->options,
  				    tmp);
+ 		if (trace)
+ 			(void) fprintf(stderr, "-> diff_fileproc: (empty_file !=
DIFF_ADDED) RCS_checkout of rev %s returned %d\n",use_rev1,retcode);
+ 
  	    if (retcode == -1)
  	    {
  		(void) CVS_UNLINK (tmp);
***************
*** 568,586 ****
  	    }
  	    /* FIXME: what if retcode > 0?  */
  
! 	    run_setup ("%s %s %s %s", DIFF, opts, tmp, DEVNULL);
  	}
      }
      else
      {
  	if (use_rev2)
  	{
  	    run_setup ("%s%s -x,v/ %s %s -r%s -r%s", Rcsbin, RCS_DIFF,
  		       opts, *options ? options : vers->options,
  		       use_rev1, use_rev2);
  	}
  	else
  	{
  	    run_setup ("%s%s -x,v/ %s %s -r%s", Rcsbin, RCS_DIFF, opts,
  		       *options ? options : vers->options, use_rev1);
  	}
--- 607,642 ----
  	    }
  	    /* FIXME: what if retcode > 0?  */
  
! 	    run_setup ("%s %s %s %s %s", DIFF, process_binary, opts, tmp,
DEVNULL_IN);
  	}
      }
      else
      {
  	if (use_rev2)
  	{
+ 		if (trace) {
+ 			(void) fprintf(stderr, "-> diff_fileproc: (use_rev2) run_setup
(\"%s%s -x,v/ %s %s -r%s -r%s\")\n",
+ 			 			   Rcsbin, RCS_DIFF, opts, *options ? options : vers->options,
+ 					       use_rev1, use_rev2);
+ 		}
+ 
+ 		if (use_rev1 == NULL) {
+ 			(void) fprintf(stderr, "****> diff_fileproc: use_rev2 and use_rev1
NULL!\n");
+ 			exit(2);
+ 		}
+ 
  	    run_setup ("%s%s -x,v/ %s %s -r%s -r%s", Rcsbin, RCS_DIFF,
  		       opts, *options ? options : vers->options,
  		       use_rev1, use_rev2);
  	}
  	else
  	{
+ 		if (trace) {
+ 			(void) fprintf(stderr, "-> diff_fileproc: (!use_rev2) run_setup
(\"%s%s -x,v/ %s %s -r%s\")\n",
+ 						   Rcsbin, RCS_DIFF, opts, *options ? options : vers->options,
+ 						   use_rev1);
+ 		}
+ 
  	    run_setup ("%s%s -x,v/ %s %s -r%s", Rcsbin, RCS_DIFF, opts,
  		       *options ? options : vers->options, use_rev1);
  	}
***************
*** 854,859 ****
--- 910,919 ----
  			    (char *) NULL,
  			    *options ? options : vers->options,
  			    tmp);
+ 
+ 	if (trace)
+ 		(void) fprintf(stderr, "-> diff_fileproc: (empty_file ==
DIFF_DIFFERENT) RCS_checkout of rev %s returned %d\n",use_rev1,retcode);
+ 
      switch (retcode)
      {
  	case 0:				/* everything ok */
Index: CVS_src/src/edit.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/edit.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 edit.c
*** edit.c	1997/01/15 16:27:18	1.1.1.1
--- edit.c	1997/02/19 15:50:29
***************
*** 178,185 ****
  	return 0;
      }
  
!     while (getline (&line, &line_len, fp) > 0)
!     {
  	notif_type = line[0];
  	if (notif_type == '\0')
  	    continue;
--- 178,184 ----
  	return 0;
      }
  
!     while (getline (&line, &line_len, fp) > 0) {
  		notif_type = line[0];
  		if (notif_type == '\0')
  		    continue;
***************
*** 205,210 ****
--- 204,211 ----
  		cp = strchr (cp, '\n');
  		if (cp == NULL)
  		    continue;
+ 		if (*(cp-1) == '\r')	/*	for DOS, remove CR, as well	*/
+ 			--cp;
  		*cp = '\0';
  
  		notify_do (notif_type, filename, getcaller (), val, watches,
Index: CVS_src/src/entries.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/entries.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 entries.c
*** entries.c	1997/01/15 16:27:18	1.1.1.1
--- entries.c	1997/02/19 15:50:29
***************
*** 326,331 ****
--- 326,333 ----
  	tag_or_date = cp;
  	if ((cp = strchr (tag_or_date, '\n')) == NULL)
  	    continue;
+ 	if (*(cp-1) == '\r')	/*	for DOS, remove CR, as well	*/
+ 		--cp;
  	*cp = '\0';
  	tag = (char *) NULL;
  	date = (char *) NULL;
***************
*** 654,661 ****
  	if ((line_length = getline (&line, &line_chars_allocated, fp)) > 0)
  	{
  	    /* Remove any trailing newline.  */
! 	    if (line[line_length - 1] == '\n')
  	        line[--line_length] = '\0';
  	    if (*line == 'T' && tagp)
  		*tagp = xstrdup (line + 1);
  	    else if (*line == 'D' && datep)
--- 656,667 ----
  	if ((line_length = getline (&line, &line_chars_allocated, fp)) > 0)
  	{
  	    /* Remove any trailing newline.  */
! 	    if (line[line_length - 1] == '\n') {
  	        line[--line_length] = '\0';
+ 			/*	for DOS, remove CR, as well	*/
+ 		    if (line[line_length - 1] == '\r')
+ 		        line[--line_length] = '\0';
+ 		}
  	    if (*line == 'T' && tagp)
  		*tagp = xstrdup (line + 1);
  	    else if (*line == 'D' && datep)
***************
*** 721,727 ****
  	    sprintf (entfilename, "%s/%s", parent, CVSADM_ENTLOG);
  	}
  
! 	entfile = CVS_FOPEN (entfilename, "a");
  	if (entfile == NULL)
  	{
  	    int save_errno = errno;
--- 727,733 ----
  	    sprintf (entfilename, "%s/%s", parent, CVSADM_ENTLOG);
  	}
  
! 	entfile = CVS_FOPEN (entfilename, FOPEN_BINARY_APPEND);
  	if (entfile == NULL)
  	{
  	    int save_errno = errno;
Index: CVS_src/src/filesubr.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/filesubr.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 filesubr.c
*** filesubr.c	1997/01/15 16:27:21	1.1.1.1
--- filesubr.c	1997/02/21 15:53:09
***************
*** 44,49 ****
--- 44,50 ----
      struct stat sb;
      struct utimbuf t;
      int fdin, fdout;
+ 	int touch_only = !FN_STRCMP(from, DEVNULL_IN);
  
      if (trace)
  #ifdef SERVER_SUPPORT
***************
*** 55,67 ****
      if (noexec)
  	return;
  
      if ((fdin = open (from, O_RDONLY)) < 0)
  	error (1, errno, "cannot open %s for copying", from);
      if (fstat (fdin, &sb) < 0)
  	error (1, errno, "cannot fstat %s", from);
      if ((fdout = creat (to, (int) sb.st_mode & 07777)) < 0)
  	error (1, errno, "cannot create %s for copying", to);
!     if (sb.st_size > 0)
      {
  	char buf[BUFSIZ];
  	int n;
--- 56,84 ----
      if (noexec)
  	return;
  
+ #if !defined(_WIN32)
+ 	if (!touch_only) {
  	    if ((fdin = open (from, O_RDONLY)) < 0)
  			error (1, errno, "cannot open %s for copying", from);
  	    if (fstat (fdin, &sb) < 0)
  			error (1, errno, "cannot fstat %s", from);
+ 	}
      if ((fdout = creat (to, (int) sb.st_mode & 07777)) < 0)
  		error (1, errno, "cannot create %s for copying", to);
! #else	/* !defined(_WIN32) */
! 	if (!touch_only) {
! 	    if ((fdin = open (from, O_RDONLY | O_BINARY)) < 0)
! 			error (1, errno, "cannot open %s for copying", from);
! 	    if (fstat (fdin, &sb) < 0)
! 			error (1, errno, "cannot fstat %s", from);
! 	}
!     if ((fdout = open (to, O_CREAT | O_TRUNC | O_RDWR | O_BINARY,
! 		       (int) sb.st_mode & 07777)) < 0)
! 		error (1, errno, "cannot create %s for copying", to);
! #endif	/* !defined(_WIN32) */
! 
! 
!     if (!touch_only && sb.st_size > 0)
      {
  	char buf[BUFSIZ];
  	int n;
***************
*** 91,107 ****
--- 108,128 ----
  #endif
      }
  
+ 	if (!touch_only) {
  	    if (close (fdin) < 0) 
  			error (0, errno, "cannot close %s", from);
+ 	}
      if (close (fdout) < 0)
  	error (1, errno, "cannot close %s", to);
  
+ 	if (!touch_only) {
  	    /* now, set the times for the copied file to match those of the
original */
  	    memset ((char *) &t, 0, sizeof (t));
  	    t.actime = sb.st_atime;
  	    t.modtime = sb.st_mtime;
  	    (void) utime (to, &t);
  	}
+ }
  
  /* FIXME-krp: these functions would benefit from caching the char * &
     stat buf.  */***************
*** 116,123 ****
  {
      struct stat sb;
  
!     if (stat (file, &sb) < 0)
  	return (0);
      return (S_ISDIR (sb.st_mode));
  }
  
--- 137,158 ----
  {
      struct stat sb;
  
! 	if (trace) {
! 		char cwdbuf[100];
! 
! 		getcwd(cwdbuf, 100);
! 		(void) fprintf (stderr, "-> isdir(%s): cwd = %s\n", file, cwdbuf);
! 	}
! 
!     if (stat (file, &sb) < 0) {
! 		if (trace)
! 			(void) fprintf (stderr, "-> isdir(%s): file not found\n", file);
  		return (0);
+ 	}
+ 
+ 	if (trace)
+ 		(void) fprintf (stderr, "-> isdir(%s): sb.st_mode = %d\n", file,
sb.st_mode);
+ 
      return (S_ISDIR (sb.st_mode));
  }
  
***************
*** 299,311 ****
  {
      if (mkdir (name, 0777) < 0)
      {
! 	if (errno != EEXIST)
  	    error (1, errno, "cannot make directory %s", name);
  	return 1;
      }
      return 0;
  }
  
  /*
   * Change the mode of a file, either adding write permissions, or
removing
   * all write permissions.  Either change honors the current umask
setting.
--- 334,360 ----
  {
      if (mkdir (name, 0777) < 0)
      {
! 	if (errno != EEXIST
! #if defined(_WIN32)
! #ifdef EACCESS
! 	    /* This was copied over from the OS/2 code; I would guess it
! 	       isn't needed here but that has not been verified.  */
! 	    && errno != EACCESS
! #endif
! #ifdef EACCES
! 	    /* This is said to be needed by NT on Alpha or PowerPC
! 	       (not sure what version) --August, 1996.  */
! 	    && errno != EACCES
! #endif
! #endif	/* defined(_WIN32) */
! 		)
  	    error (1, errno, "cannot make directory %s", name);
  	return 1;
      }
      return 0;
  }
  
+ #if !defined(_WIN32)
  /*
   * Change the mode of a file, either adding write permissions, or
removing
   * all write permissions.  Either change honors the current umask
setting.
***************
*** 354,359 ****
--- 403,469 ----
  	error (0, errno, "cannot change mode of file %s", fname);
  }
  
+ #else	/* !defined(_WIN32) */
+ 
+ /*
+  * Change the mode of a file, either adding write permissions, or
removing
+  * all write permissions.  Adding write permissions honors the current
umask
+  * setting.
+  */
+ void
+ xchmod (fname, writable)
+     char *fname;
+     int writable;
+ {
+     struct stat sb;
+     mode_t mode, oumask;
+ 
+     if (stat (fname, &sb) < 0)
+     {
+ 	if (!noexec)
+ 	    error (0, errno, "cannot stat %s", fname);
+ 	return;
+     }
+     if (writable)
+     {
+ 	oumask = umask (0);
+ 	(void) umask (oumask);
+ 	mode = sb.st_mode | ~oumask & (((sb.st_mode & S_IRUSR) ? S_IWUSR : 0)
|
+ 				       ((sb.st_mode & S_IRGRP) ? S_IWGRP : 0) |
+ 				       ((sb.st_mode & S_IROTH) ? S_IWOTH : 0));
+     }
+     else
+     {
+ 	mode = sb.st_mode & ~(S_IWRITE | S_IWGRP | S_IWOTH);
+     }
+ 
+     if (trace)
+ #ifdef SERVER_SUPPORT
+ 	(void) fprintf (stderr, "%c-> chmod(%s,%o)\n",
+ 			(server_active) ? 'S' : ' ', fname, mode);
+ #else
+ 	(void) fprintf (stderr, "-> chmod(%s,%o)\n", fname, mode);
+ #endif
+     if (noexec)
+ 	return;
+ 
+     if (chmod (fname, mode) < 0)
+ 	error (0, errno, "cannot change mode of file %s", fname);
+ }
+ #endif	/* !defined(_WIN32) */
+ 
+ 
+ #if defined(_WIN32)
+ /* Read the value of a symbolic link.
+    Under Windows NT, this function always returns EINVAL.  */
+ int
+ readlink (char *path, char *buf, int buf_size)
+ {
+     errno = EINVAL;
+     return -1;
+ }
+ #endif	/* defined(_WIN32) */
+ 
  /*
   * Rename a file and die if it fails
   */
***************
*** 372,381 ****
--- 482,498 ----
      if (noexec)
  	return;
  
+ #if defined(_WIN32)
+     /* Win32 unlink is stupid --- it fails if the file is read-only
*/
+     chmod(to, S_IWRITE);
+     unlink(to);
+ #endif	/* defined(_WIN32) */
+ 
      if (rename (from, to) < 0)
  	error (1, errno, "cannot rename file %s to %s", from, to);
  }
  
+ #if !defined(_WIN32)
  /*
   * link a file, if possible.  Warning: the Windows NT version of this
   * function just copies the file, so only use this function in ways
***************
*** 399,404 ****
--- 516,542 ----
      return (link (from, to));
  }
  
+ #else	/* !defined(_WIN32) */
+ 
+ /* Windows NT doesn't have hard links or symbolic links.
+    There was only one place in CVS which used this function,
+    so I rewrote it to work another way, so this function isn't
+    used any more.  */
+ /*
+  * link a file, if possible.
+  */
+ int
+ link_file (from, to)
+     const char *from;
+     const char *to;
+ {
+     copy_file (from, to);
+     return 0;
+ }
+ 
+ #endif	/* !defined(_WIN32) */
+ 
+ 
  /*
   * unlink a file, if possible.
   */
***************
*** 416,421 ****
--- 554,563 ----
      if (noexec)
  	return (0);
  
+ #if defined(_WIN32)
+     /* Win32 unlink is stupid - it fails if the file is read-only */
+     chmod (f, S_IWRITE);
+ #endif	/* defined(_WIN32) */
      return (unlink (f));
  }
  
***************
*** 446,455 ****
         call to isdir() and the call to unlink(), we'll still corrupt
         the filesystem.  Where is the Unix Haters Handbook when you
need
         it?  */
!     if (isdir(f)) 
  	return deep_remove_dir(f);
!     else
!     {
  	if (unlink (f) != 0)
  	    return -1;
      }
--- 698,708 ----
         call to isdir() and the call to unlink(), we'll still corrupt
         the filesystem.  Where is the Unix Haters Handbook when you
need
         it?  */
!     if (isdir(f)) {
! 		if (trace)
! 			(void) fprintf (stderr, "-> unlink_file_dir(%s): calling
deep_remove_dir\n", f);
  		return deep_remove_dir(f);
!     } else {
  	if (unlink (f) != 0)
  	    return -1;
      }
***************
*** 469,475 ****
      struct dirent *dp;
      char	   buf[PATH_MAX];
  
!     if (rmdir (path) != 0 && (errno == ENOTEMPTY || errno == EEXIST)) 
      {
  	if ((dirp = opendir (path)) == NULL)
  	    /* If unable to open the directory return
--- 722,733 ----
      struct dirent *dp;
      char	   buf[PATH_MAX];
  
!     if (rmdir (path) != 0 && (errno == ENOTEMPTY || errno == EEXIST
! #if defined(_WIN32)
!     /* ENOTEMPTY for NT (obvious) but EACCES for Win95 (not obvious)
*/
! 							  || errno == EACCES
! #endif	/* defined(_WIN32) */
!         )) 
      {
  	if ((dirp = opendir (path)) == NULL)
  	    /* If unable to open the directory return
***************
*** 479,485 ****
  
  	while ((dp = readdir (dirp)) != NULL)
  	{
! 	    if (strcmp (dp->d_name, ".") == 0 ||
  			strcmp (dp->d_name, "..") == 0)
  		continue;
  
--- 737,744 ----
  
  	while ((dp = readdir (dirp)) != NULL)
  	{
! 	    if (strlen(dp->d_name) == 0 ||	/* bypass cygwin.dll rel. b17.1
bug */
! 	    	strcmp (dp->d_name, ".") == 0 ||
  			strcmp (dp->d_name, "..") == 0)
  		continue;
  
***************
*** 561,570 ****
--- 821,838 ----
      int fd1, fd2;
      int ret;
  
+ #if !defined(_WIN32)
      if ((fd1 = open (file1, O_RDONLY)) < 0)
  	error (1, errno, "cannot open file %s for comparing", file1);
      if ((fd2 = open (file2, O_RDONLY)) < 0)
  	error (1, errno, "cannot open file %s for comparing", file2);
+ #else	/* !defined(_WIN32) */
+     if ((fd1 = open (file1, O_RDONLY | O_BINARY)) < 0)
+ 	error (1, errno, "cannot open file %s for comparing", file1);
+     if ((fd2 = open (file2, O_RDONLY | O_BINARY)) < 0)
+ 	error (1, errno, "cannot open file %s for comparing", file2);
+ #endif	/* !defined(_WIN32) */
+ 
      if (fstat (fd1, &sb1) < 0)
  	error (1, errno, "cannot fstat %s", file1);
      if (fstat (fd2, &sb2) < 0)
***************
*** 630,647 ****
      return xstrdup (value);
  }
  #else
  /* Generate a unique temporary filename.  Returns a pointer to a newly
     malloc'd string containing the name.  Returns successfully or not
at
     all.  */
  char *
  cvs_temp_name ()
  {
-     char value[L_tmpnam + 1];
      char *retval;
  
      /* FIXME: should be using TMPDIR, perhaps by using tempnam on
systems
         which have it.  */
      retval = tmpnam (value);
      if (retval == NULL)
  	error (1, errno, "cannot generate temporary filename");
      return xstrdup (retval);
--- 898,925 ----
      return xstrdup (value);
  }
  #else
+ 
+ #if defined(_WIN32)
+ char *tempnam(char *dir, char *prefix);
+ #endif	/* defined(_WIN32) */
+ 
  /* Generate a unique temporary filename.  Returns a pointer to a newly
     malloc'd string containing the name.  Returns successfully or not
at
     all.  */
  char *
  cvs_temp_name ()
  {
      char *retval;
+ #if !defined(_WIN32)
+     char value[L_tmpnam + 1];
  
      /* FIXME: should be using TMPDIR, perhaps by using tempnam on
systems
         which have it.  */
      retval = tmpnam (value);
+ #else	/* !defined(_WIN32) */
+     retval = tempnam (".", "#");
+ #endif	/* !defined(_WIN32) */
+ 
      if (retval == NULL)
  	error (1, errno, "cannot generate temporary filename");
      return xstrdup (retval);
***************
*** 654,669 ****
  isabsolute (filename)
      const char *filename;
  {
!     return filename[0] == '/';
  }

  /* Return a pointer into PATH's last component.  */
  char *
! last_component (path)
!     char *path;
  {
!     char *last = strrchr (path, '/');
  
      if (last)
          return last + 1;
--- 932,957 ----
  isabsolute (filename)
      const char *filename;
  {
!     return (ISDIRSEP (filename[0])
! #if defined(_WIN32)
!             || (isalpha(filename[0])
!                 && filename[1] == ':'
!                 && ISDIRSEP (filename[2]))
! #endif	/* defined(_WIN32) */
!            );
  }

  /* Return a pointer into PATH's last component.  */
  char *
! last_component (char *path)
  {
!     char *scan;
!     char *last = 0;
! 
!     for (scan = path; *scan; scan++)
!         if (ISDIRSEP (*scan))
! 	    last = scan;
  
      if (last)
          return last + 1;
***************
*** 671,676 ****
--- 959,966 ----
          return path;
  }
  
+ 
+ #if !defined(_WIN32)
  /* Return the home directory.  Returns a pointer to storage
     managed by this function or its callees (currently getenv).  */
  char *
***************
*** 691,696 ****
--- 981,1022 ----
      return home;
  }
  
+ #else	/* !defined(_WIN32) */
+ 
+ /* NT has two evironment variables, HOMEPATH and HOMEDRIVE, which,
+    when combined as ${HOMEDRIVE}${HOMEPATH}, give the unix equivalent
+    of HOME.  Some NT users are just too unixy, though, and set the
+    HOME variable themselves.  Therefore, we check for HOME first, and
+    then try to combine the other two if that fails.  */
+ 
+ char *
+ get_homedir ()
+ {
+     static char pathbuf[PATH_MAX * 2];
+     char *hd, *hp;
+ 
+     if ((hd = getenv ("HOME")))
+ 	return hd;
+     else if ((hd = getenv ("HOMEDRIVE")) && (hp = getenv
("HOMEPATH")))
+     {
+ 	/* Watch for buffer overruns. */
+ 
+ #define cvs_min(x,y) ((x <= y) ? (x) : (y))
+ 
+ 	int ld = cvs_min (PATH_MAX, strlen (hd));
+ 	int lp = cvs_min (PATH_MAX, strlen (hp));
+ 
+ 	strncpy (pathbuf, hd, ld);
+ 	strncpy (pathbuf + ld, hp, lp);
+ 
+ 	return pathbuf;
+     }
+     else
+ 	return NULL;
+ }
+ #endif	/* !defined(_WIN32) */
+ 
+ 
  /* See cvs.h for description.  On unix this does nothing, because the
     shell expands the wildcards.  */
  void
***************
*** 706,708 ****
--- 1032,1237 ----
      for (i = 0; i < argc; ++i)
  	(*pargv)[i] = xstrdup (argv[i]);
  }
+ 
+ 
+ #if defined(_WIN32)
+ 
+ /* Read data from INFILE, and copy it to OUTFILE. 
+    Open INFILE using INFLAGS, and OUTFILE using OUTFLAGS.
+    This is useful for converting between CRLF and LF line formats.  */
+ void
+ convert_file (char *infile,  int inflags,
+ 	      char *outfile, int outflags)
+ {
+     int infd, outfd;
+     char buf[8192];
+     int len;
+ 
+     if ((infd = open (infile, inflags)) < 0)
+         error (1, errno, "couldn't read %s", infile);
+     if ((outfd = open (outfile, outflags, S_IWRITE)) < 0)
+         error (1, errno, "couldn't write %s", outfile);
+ 
+     while ((len = read (infd, buf, sizeof (buf))) > 0)
+         if (write (outfd, buf, len) < 0)
+ 	    error (1, errno, "error writing %s", outfile);
+     if (len < 0)
+         error (1, errno, "error reading %s", infile);
+ 
+     if (close (outfd) < 0)
+         error (0, errno, "warning: couldn't close %s", outfile);
+     if (close (infd) < 0)
+         error (0, errno, "warning: couldn't close %s", infile);
+ }
+ 
+ 
+ #undef getwd
+ extern char* getwd(char*);
+ 
+ char* dosNormGetwd(char* cwdBuf) {
+ 	char* result = getwd(cwdBuf);
+ 
+ 
+ 	if (result != cwdBuf) {
+ 		return result;
+ 	}
+ 
+ 	if (ISDIRSEP(cwdBuf[0])) {
+ 		/*	Presume that convention "x:/" -> "/x/" holds	*/
+ 		/**/
+ 		if (isalpha(cwdBuf[1]) && ISDIRSEP(cwdBuf[2])) {
+ 			cwdBuf[0] = cwdBuf[1];
+ 			cwdBuf[1] = ':';
+ 
+ 		/*	Un-mapped BASH drive.  "x:/" -> "//x/"			*/
+ 		/**/
+ 		} else if (ISDIRSEP(cwdBuf[1])
+ 				   && isalpha(cwdBuf[2]) && ISDIRSEP(cwdBuf[3])) {
+ 			char *dst = cwdBuf+2;
+ 			char *src = cwdBuf+3;
+ 
+ 			cwdBuf[0] = cwdBuf[2];
+ 			cwdBuf[1] = ':';
+ 			do {
+ 				*dst = *src;
+ 				dst++;
+ 				src++;
+ 			} while (*dst != '\0');			
+ 
+ 		} else {
+ 			/*	hope RCS understands it!					*/
+ 		}
+ 	}
+ 	return cwdBuf;
+ }
+ 
+ 
+ /* The equivalence class mapping for filenames.
+    Windows NT filenames are case-insensitive, but case-preserving.
+    Both / and \ are path element separators.
+    Thus, this table maps both upper and lower case to lower case, and
+    both / and \ to /.  */
+ 
+ #if 0
+ main ()
+ {
+   int c;
+ 
+   for (c = 0; c < 256; c++)
+     {
+       int t;
+ 
+       if (c == '\\')
+         t = '/';
+       else
+         t = tolower (c);
+       
+       if ((c & 0x7) == 0x0)
+          printf ("    ");
+       printf ("0x%02x,", t);
+       if ((c & 0x7) == 0x7)
+          putchar ('\n');
+       else if ((c & 0x7) == 0x3)
+          putchar (' ');
+     }
+ }
+ #endif
+ 
+ 
+ unsigned char
+ WNT_filename_classes[] =
+ {
+     0x00,0x01,0x02,0x03, 0x04,0x05,0x06,0x07,
+     0x08,0x09,0x0a,0x0b, 0x0c,0x0d,0x0e,0x0f,
+     0x10,0x11,0x12,0x13, 0x14,0x15,0x16,0x17,
+     0x18,0x19,0x1a,0x1b, 0x1c,0x1d,0x1e,0x1f,
+     0x20,0x21,0x22,0x23, 0x24,0x25,0x26,0x27,
+     0x28,0x29,0x2a,0x2b, 0x2c,0x2d,0x2e,0x2f,
+     0x30,0x31,0x32,0x33, 0x34,0x35,0x36,0x37,
+     0x38,0x39,0x3a,0x3b, 0x3c,0x3d,0x3e,0x3f,
+     0x40,0x61,0x62,0x63, 0x64,0x65,0x66,0x67,
+     0x68,0x69,0x6a,0x6b, 0x6c,0x6d,0x6e,0x6f,
+     0x70,0x71,0x72,0x73, 0x74,0x75,0x76,0x77,
+     0x78,0x79,0x7a,0x5b, 0x2f,0x5d,0x5e,0x5f,
+     0x60,0x61,0x62,0x63, 0x64,0x65,0x66,0x67,
+     0x68,0x69,0x6a,0x6b, 0x6c,0x6d,0x6e,0x6f,
+     0x70,0x71,0x72,0x73, 0x74,0x75,0x76,0x77,
+     0x78,0x79,0x7a,0x7b, 0x7c,0x7d,0x7e,0x7f,
+     0x80,0x81,0x82,0x83, 0x84,0x85,0x86,0x87,
+     0x88,0x89,0x8a,0x8b, 0x8c,0x8d,0x8e,0x8f,
+     0x90,0x91,0x92,0x93, 0x94,0x95,0x96,0x97,
+     0x98,0x99,0x9a,0x9b, 0x9c,0x9d,0x9e,0x9f,
+     0xa0,0xa1,0xa2,0xa3, 0xa4,0xa5,0xa6,0xa7,
+     0xa8,0xa9,0xaa,0xab, 0xac,0xad,0xae,0xaf,
+     0xb0,0xb1,0xb2,0xb3, 0xb4,0xb5,0xb6,0xb7,
+     0xb8,0xb9,0xba,0xbb, 0xbc,0xbd,0xbe,0xbf,
+     0xc0,0xc1,0xc2,0xc3, 0xc4,0xc5,0xc6,0xc7,
+     0xc8,0xc9,0xca,0xcb, 0xcc,0xcd,0xce,0xcf,
+     0xd0,0xd1,0xd2,0xd3, 0xd4,0xd5,0xd6,0xd7,
+     0xd8,0xd9,0xda,0xdb, 0xdc,0xdd,0xde,0xdf,
+     0xe0,0xe1,0xe2,0xe3, 0xe4,0xe5,0xe6,0xe7,
+     0xe8,0xe9,0xea,0xeb, 0xec,0xed,0xee,0xef,
+     0xf0,0xf1,0xf2,0xf3, 0xf4,0xf5,0xf6,0xf7,
+     0xf8,0xf9,0xfa,0xfb, 0xfc,0xfd,0xfe,0xff,
+ };
+ 
+ /* Like strcmp, but with the appropriate tweaks for file names.
+    Under Windows NT, filenames are case-insensitive but
case-preserving,
+    and both \ and / are path element separators.  */
+ int
+ fncmp (const char *n1, const char *n2) {
+ 	/*	Normalize //<drive letter>/ to /<drive letter>/				*/
+ 	/**/
+ 	if (*n1 == '/' && *(n1 + 1) == '/'
+ 		&& isalpha(*(n1 + 2)) && *(n1 + 3) == '/') {
+ 		n1++;
+ 	}
+ 	if (*n2 == '/' && *(n2 + 1) == '/'
+ 		&& isalpha(*(n2 + 2)) && *(n2 + 3) == '/') {
+ 		n1++;
+ 	}
+ 
+ 	/*	re-map '<drive letter>:/' to '/<drive letter>/'	*/
+ 	/**/
+ 	if (*n1 == '/' && isalpha(*(n1 + 1)) && *(n1 + 2) == '/'
+ 		&& isalpha(*n2) && *(n2+1) == ':') {
+ 		if (WNT_filename_classes[(unsigned char) *(n1+1)]
+ 			!= WNT_filename_classes[(unsigned char) *n2]) {
+ 			return FALSE;
+ 		} else {
+ 			n1 += 2;
+ 			n2 += 2;
+ 		}
+ 	} else if (*n2 == '/' && isalpha(*(n2 + 1)) && *(n2 + 2) == '/'
+ 			   && isalpha(*n1) && *(n1+1) == ':') {
+ 		if (WNT_filename_classes[(unsigned char) *(n2+1)]
+ 			!= WNT_filename_classes[(unsigned char) *n1]) {
+ 			return FALSE;
+ 		} else {
+ 			n1 += 2;
+ 			n2 += 2;
+ 		}
+ 	}
+ 
+     while (*n1 && *n2
+            && (WNT_filename_classes[(unsigned char) *n1]
+ 	       == WNT_filename_classes[(unsigned char) *n2]))
+         n1++, n2++;
+     return (WNT_filename_classes[(unsigned char) *n1]
+             - WNT_filename_classes[(unsigned char) *n2]);
+ }
+ 
+ /* Fold characters in FILENAME to their canonical forms.  
+    If FOLD_FN_CHAR is not #defined, the system provides a default
+    definition for this.  */
+ void
+ fnfold (char *filename)
+ {
+     while (*filename)
+     {
+         *filename = FOLD_FN_CHAR (*filename);
+ 	filename++;
+     }
+ }
+ 
+ #endif	/* defined(_WIN32) */
Index: CVS_src/src/find_names.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/find_names.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 find_names.c
*** find_names.c	1997/01/15 16:27:18	1.1.1.1
--- find_names.c	1997/02/20 15:30:13
***************
*** 45,50 ****
--- 45,55 ----
      fnode = getnode ();
      fnode->type = FILES;
      fnode->key = xstrdup (node->key);
+ 
+ 	if (trace) {
+ 		(void) fprintf (stderr, "-> Find_Names/add_entries_proc: entry = %s
\n", node->key);
+ 	}
+ 
      if (addnode (filelist, fnode) != 0)
  	freenode (fnode);
      return (0);
***************
*** 83,88 ****
--- 88,98 ----
  	entries = Entries_Open (aflag);
  	if (entries != NULL)
  	{
+ 
+ 		if (trace) {
+ 			(void) fprintf (stderr, "-> Find_Names(%s): entries file found\n",
repository);
+ 		}
+ 
  	    /* walk the entries file adding elements to the files list */
  	    (void) walklist (entries, add_entries_proc, NULL);
  
***************
*** 302,312 ****
      /* read the dir, grabbing sub-dirs */
      while ((dp = readdir (dirp)) != NULL)
      {
! 	if (strcmp (dp->d_name, ".") == 0 ||
  	    strcmp (dp->d_name, "..") == 0 ||
! 	    strcmp (dp->d_name, CVSATTIC) == 0 ||
! 	    strcmp (dp->d_name, CVSLCK) == 0 ||
! 	    strcmp (dp->d_name, CVSREP) == 0)
  	    continue;
  
  	/* findnode() is going to be significantly faster than stat()
--- 312,323 ----
      /* read the dir, grabbing sub-dirs */
      while ((dp = readdir (dirp)) != NULL)
      {
! 	if (strlen(dp->d_name) == 0 ||	/* bypass cygwin.dll rel. b17 bug */
! 		strcmp (dp->d_name, ".") == 0 ||
  	    strcmp (dp->d_name, "..") == 0 ||
! 	    FN_STRCMP (dp->d_name, CVSATTIC) == 0 ||
! 	    FN_STRCMP (dp->d_name, CVSLCK) == 0 ||
! 	    FN_STRCMP (dp->d_name, CVSREP) == 0)
  	    continue;
  
  	/* findnode() is going to be significantly faster than stat()
Index: CVS_src/src/history.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/history.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 history.c
*** history.c	1997/01/15 16:27:18	1.1.1.1
--- history.c	1997/02/27 18:53:03
***************
*** 713,719 ****
  	{
  	    /* Assumes neither CurDir nor pwdir ends in '/' */
  	    i = strlen (pwdir);
! 	    if (!strncmp (CurDir, pwdir, i))
  	    {
  		PrCurDir += i;		/* Point to '/' separator */
  		tilde = "~";
--- 713,719 ----
  	{
  	    /* Assumes neither CurDir nor pwdir ends in '/' */
  	    i = strlen (pwdir);
! 	    if (!FN_STRNCMP (CurDir, pwdir, i))
  	    {
  		PrCurDir += i;		/* Point to '/' separator */
  		tilde = "~";
***************
*** 730,736 ****
  		(void) CVS_CHDIR (workdir);
  
  		i = strlen (homedir);
! 		if (!strncmp (CurDir, homedir, i))
  		{
  		    PrCurDir += i;	/* Point to '/' separator */
  		    tilde = "~";
--- 730,736 ----
  		(void) CVS_CHDIR (workdir);
  
  		i = strlen (homedir);
! 		if (!FN_STRNCMP (CurDir, homedir, i))
  		{
  		    PrCurDir += i;	/* Point to '/' separator */
  		    tilde = "~";
***************
*** 945,950 ****
--- 945,952 ----
  	line++;
      if (!(rtn = strchr (line, '\n')))
  		return ("");
+ 	if (*(rtn-1) == '\r')	/*	for DOS, remove CR, as well	*/
+ 		*(rtn-1) = '\0';
      *rtn++ = '\0';
  
      hr->type = line++;
***************
*** 1006,1011 ****
--- 1008,1016 ----
  	error (1, 0, "history file is empty");
      cp = xmalloc (i + 2);
  
+ 	if (trace)
+ 		(void) fprintf(stderr, "read_hrecs(%s): file opened, size
%d\n",fname, i);
+ 
      if (read (fd, cp, i) != i)
  	error (1, errno, "cannot read log file");
      (void) close (fd);
***************
*** 1237,1243 ****
  		{
  		    cp++;
  		    /* if argument to -p is a prefix of repository */
! 		    if (!strncmp (cp, hr->repos, strlen (cp)))
  		    {
  			hr->mod = fl->l_module;
  			break;
--- 1242,1248 ----
  		{
  		    cp++;
  		    /* if argument to -p is a prefix of repository */
! 		    if (!FN_STRNCMP (cp, hr->repos, strlen (cp)))
  		    {
  			hr->mod = fl->l_module;
  			break;
***************
*** 1457,1464 ****
  	    strcmp (hr->user, lr->user) ||	/* User has changed */
  	    strcmp (hr->mod, lr->mod) ||/* Module has changed */
  	    (working &&			/* If must match "workdir" */
! 	     (strcmp (hr->dir, lr->dir) ||	/*    and the 1st parts or */
! 	      strcmp (hr->end, lr->end))))	/*    the 2nd parts differ */
  
  	    return (1);
      }
--- 1462,1469 ----
  	    strcmp (hr->user, lr->user) ||	/* User has changed */
  	    strcmp (hr->mod, lr->mod) ||/* Module has changed */
  	    (working &&			/* If must match "workdir" */
! 	     (FN_STRCMP (hr->dir, lr->dir) ||	/*    and the 1st parts or */
! 	      FN_STRCMP (hr->end, lr->end))))	/*    the 2nd parts differ */
  
  	    return (1);
      }
***************
*** 1466,1479 ****
      {
  	if (!last_entry ||		/* Don't want only last rec */
  	    !hr ||			/* Last entry is a "last entry" */
! 	    strcmp (hr->repos, lr->repos) ||	/* Repository has changed */
! 	    strcmp (hr->file, lr->file))/* File has changed */
  	    return (1);
  
  	if (working)
  	{				/* If must match "workdir" */
! 	    if (strcmp (hr->dir, lr->dir) ||	/*    and the 1st parts or */
! 		strcmp (hr->end, lr->end))	/*    the 2nd parts differ */
  		return (1);
  	}
      }
--- 1471,1484 ----
      {
  	if (!last_entry ||		/* Don't want only last rec */
  	    !hr ||			/* Last entry is a "last entry" */
! 	    FN_STRCMP (hr->repos, lr->repos) ||	/* Repository has changed */
! 	    FN_STRCMP (hr->file, lr->file))/* File has changed */
  	    return (1);
  
  	if (working)
  	{				/* If must match "workdir" */
! 	    if (FN_STRCMP (hr->dir, lr->dir) ||	/*    and the 1st parts or */
! 		FN_STRCMP (hr->end, lr->end))	/*    the 2nd parts differ */
  		return (1);
  	}
      }
***************
*** 1482,1489 ****
  	if (!last_entry ||		/* Don't want only last rec */
  	    !hr ||			/* Last entry is a "last entry" */
  	    strcmp (hr->mod, lr->mod) ||/* Module has changed */
! 	    strcmp (hr->repos, lr->repos) ||	/* Repository has changed */
! 	    strcmp (hr->file, lr->file))/* File has changed */
  	    return (1);
      }
      else
--- 1487,1494 ----
  	if (!last_entry ||		/* Don't want only last rec */
  	    !hr ||			/* Last entry is a "last entry" */
  	    strcmp (hr->mod, lr->mod) ||/* Module has changed */
! 	    FN_STRCMP (hr->repos, lr->repos) ||	/* Repository has changed */
! 	    FN_STRCMP (hr->file, lr->file))/* File has changed */
  	    return (1);
      }
      else
Index: CVS_src/src/ignore.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/ignore.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 ignore.c
*** ignore.c	1997/01/15 16:27:18	1.1.1.1
--- ignore.c	1997/02/20 15:30:13
***************
*** 15,21 ****
  static char **ign_list;			/* List of files to ignore in update
  					 * and import */
  static char **s_ign_list = NULL;
! static int ign_count;			/* Number of active entries */
  static int s_ign_count = 0;
  static int ign_size;			/* This many slots available (plus
  					 * one for a NULL) */
--- 15,21 ----
  static char **ign_list;			/* List of files to ignore in update
  					 * and import */
  static char **s_ign_list = NULL;
! static int ign_count = 0;			/* Number of active entries */
  static int s_ign_count = 0;
  static int ign_size;			/* This many slots available (plus
  					 * one for a NULL) */
***************
*** 167,191 ****
  	 */
  	if ((!*(ign+1) || isspace (*(ign+1))) && (*ign == '!' || *ign ==
'*'))
  	{
! 	    if (!hold)
! 	    {
  		/* permanently reset the ignore list */
  		int i;
  
  		for (i = 0; i < ign_count; i++)
  		    free (ign_list[i]);
  		ign_count = 0;
  		ign_list[0] = NULL;
  
  		/* if we are doing a '!', continue; otherwise add the '*' */
! 		if (*ign == '!')
! 		{
  		    ign_inhibit_server = 1;
  		    continue;
  		}
! 	    }
! 	    else if (*ign == '!')
! 	    {
  		/* temporarily reset the ignore list */
  		int i;
  
--- 167,189 ----
  	 */
  	if ((!*(ign+1) || isspace (*(ign+1))) && (*ign == '!' || *ign ==
'*'))
  	{
! 	    if (!hold) {
  			/* permanently reset the ignore list */
  			int i;
  
+ 			if (ign_list) {		/*	initialization boundary condition	*/
  				for (i = 0; i < ign_count; i++)
  				    free (ign_list[i]);
  				ign_count = 0;
  				ign_list[0] = NULL;
+ 			}
  
  			/* if we are doing a '!', continue; otherwise add the '*' */
! 			if (*ign == '!') {
  			    ign_inhibit_server = 1;
  			    continue;
  			}
! 	    } else if (*ign == '!') {
  			/* temporarily reset the ignore list */
  			int i;
  
***************
*** 200,212 ****
  		    s_ign_list[i] = ign_list[i];
  		s_ign_count = ign_count;
  		ign_count = 0;
  		ign_list[0] = NULL;
  		continue;
  	    }
  	}
  
  	/* If we have used up all the space, add some more */
! 	if (ign_count >= ign_size)
  	{
  	    ign_size += IGN_GROW;
  	    ign_list = (char **) xrealloc ((char *) ign_list,
--- 198,212 ----
  			    s_ign_list[i] = ign_list[i];
  			s_ign_count = ign_count;
  			ign_count = 0;
+ 			if (ign_list) {
  				ign_list[0] = NULL;
+ 			}
  			continue;
  	    }
  	}
  
  	/* If we have used up all the space, add some more */
! 	if ((ign_count) >= ign_size)
  	{
  	    ign_size += IGN_GROW;
  	    ign_list = (char **) xrealloc ((char *) ign_list,
***************
*** 320,326 ****
    i = dir_ign_current;
    while (i--)
      {
!       if (strncmp(name, dir_ign_list[i], strlen(dir_ign_list[i])) ==
0)
  	return 1;
      }
  
--- 320,326 ----
    i = dir_ign_current;
    while (i--)
      {
!       if (FN_STRNCMP(name, dir_ign_list[i], strlen(dir_ign_list[i]))
== 0)
  	return 1;
      }
  
***************
*** 376,382 ****
      while ((dp = readdir (dirp)) != NULL)
      {
  	file = dp->d_name;
! 	if (strcmp (file, ".") == 0 || strcmp (file, "..") == 0)
  	    continue;
  	if (findnode_fn (ilist, file) != NULL)
  	    continue;
--- 376,383 ----
      while ((dp = readdir (dirp)) != NULL)
      {
  	file = dp->d_name;
! 	if (strlen(file) == 0 ||	/* bypass cygwin.dll rel. b17 bug */
! 		strcmp (file, ".") == 0 || strcmp (file, "..") == 0)
  	    continue;
  	if (findnode_fn (ilist, file) != NULL)
  	    continue;
Index: CVS_src/src/import.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/import.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 import.c
*** import.c	1997/01/15 16:27:18	1.1.1.1
--- import.c	1997/02/20 15:30:13
***************
*** 198,203 ****
--- 197,209 ----  		message = nm;
      }
  
+ 	/*	For DOS, remove trailing CR				*/
+ 	msglen = strlen(message);
+ 	if (msglen > 1 && message[msglen - 2] == '\r') {
+ 		message[msglen - 2] = '\n';
+ 		message[msglen - 1] = '\0';
+ 	}
+ 
  #ifdef CLIENT_SUPPORT
      if (client_active)
      {
***************
*** 335,340 ****
--- 341,347 ----
      struct dirent *dp;
      int err = 0;
      List *dirlist = NULL;
+ 	List *filelist = NULL;
  
      /* first, load up any per-directory ignore lists */
      ign_add_file (CVSDOTIGNORE, 1);
***************
*** 346,360 ****
      }
      else
      {
! 	while ((dp = readdir (dirp)) != NULL)
! 	{
! 	    if (strcmp (dp->d_name, ".") == 0 || strcmp (dp->d_name, "..") ==
0)
  		continue;
  #ifdef SERVER_SUPPORT
  	    /* CVS directories are created in the temp directory by
  	       server.c because it doesn't special-case import.  So
  	       don't print a message about them, regardless of -I!.  */
! 	    if (server_active && strcmp (dp->d_name, CVSADM) == 0)
  		continue;
  #endif
  	    if (ign_name (dp->d_name))
--- 353,367 ----
      }
      else
      {
! 	while ((dp = readdir (dirp)) != NULL) {
! 	    if (strlen(dp->d_name) == 0 ||	/* bypass cygwin.dll rel. b17 bug
*/
! 	    	strcmp (dp->d_name, ".") == 0 || strcmp (dp->d_name, "..") == 0)
  		continue;
  #ifdef SERVER_SUPPORT
  	    /* CVS directories are created in the temp directory by
  	       server.c because it doesn't special-case import.  So
  	       don't print a message about them, regardless of -I!.  */
! 	    if (server_active && FN_STRCMP (dp->d_name, CVSADM) == 0)
  		continue;
  #endif
  	    if (ign_name (dp->d_name))
***************
*** 393,419 ****
  	    }
  	    else
  	    {
  #ifdef CLIENT_SUPPORT
  		if (client_active)
! 		    err += client_process_import_file (message, dp->d_name,
  							   vtag, targc, targv,
  							   repository);
  		else
  #endif
! 		    err += process_import_file (message, dp->d_name,
  						vtag, targc, targv);
! 	    }
! 	}
! 	(void) closedir (dirp);
!     }
  
!     if (dirlist != NULL)
!     {
  	Node *head, *p;
  
  	head = dirlist->list;
! 	for (p = head->next; p != head; p = p->next)
! 	{
  	    err += import_descend_dir (message, p->key, vtag, targc, targv);
  	}
  
--- 400,443 ----
  	    }
  	    else
  	    {
+ 		Node *n;
+ 
+ 		if (filelist == NULL)
+ 		    filelist = getlist();
+ 
+ 		n = getnode();
+ 		n->key = xstrdup (dp->d_name);
+ 		addnode(filelist, n);
+ 	    }
+ 	}
+ 	(void) closedir (dirp);
+     }
+ 
+ 	if (filelist != NULL) {
+ 		Node *head, *p;
+ 
+ 		head = filelist->list;
+ 		for (p = head->next; p != head; p = p->next) {
+ 
  #ifdef CLIENT_SUPPORT
  			if (client_active)
! 			    err += client_process_import_file (message, p->key,
  								   vtag, targc, targv,
  								   repository);
  			else
  #endif
! 			    err += process_import_file (message, p->key,
  							vtag, targc, targv);
! 		}	/* for (p = head->next; p != head; p = p->next) */
  
! 		dellist(&filelist);
! 	}	/* if (filelist != NULL) */
! 
!     if (dirlist != NULL) {
  		Node *head, *p;
  
  		head = dirlist->list;
! 		for (p = head->next; p != head; p = p->next) {
  		    err += import_descend_dir (message, p->key, vtag, targc, targv);
  		}
  
***************
*** 512,518 ****
  	retcode = RCS_checkout (vers->srcfile, (char *) NULL, vers->vn_rcs,
  				(char *) NULL,
  #ifdef HAVE_RCS5
! 				"-ko",
  #else
  				NULL,
  #endif
--- 536,542 ----
  	retcode = RCS_checkout (vers->srcfile, (char *) NULL, vers->vn_rcs,
  				(char *) NULL,
  #ifdef HAVE_RCS5
! 				"-kb",
  #else
  				NULL,
  #endif
***************
*** 531,542 ****
  	}
  
  	tocvsPath = wrap_tocvs_process_file (vfile);
! 	different = xcmp (xtmpfile, vfile);
! 	if (tocvsPath)
  	    if (unlink_file_dir (tocvsPath) < 0)
  		error (0, errno, "cannot remove %s", tocvsPath);
  
  	(void) unlink_file (xtmpfile);
  	if (!different)
  	{
  	    int retval = 0;
--- 555,572 ----
  	}
  
  	tocvsPath = wrap_tocvs_process_file (vfile);
! 
! 	if (tocvsPath) {
! 		different = xcmp (xtmpfile, tocvsPath);
! 
  	    if (unlink_file_dir (tocvsPath) < 0)
  			error (0, errno, "cannot remove %s", tocvsPath);
+ 	} else {
+ 		different = xcmp (xtmpfile, vfile);
+ 	}
  
  	(void) unlink_file (xtmpfile);
+ 
  	if (!different)
  	{
  	    int retval = 0;
***************
*** 557,579 ****
      /* We may have failed to parse the RCS file; check just in case */
      if (vers->srcfile == NULL ||
  	add_rev (message, vers->srcfile, vfile, vers->vn_rcs) ||
! 	add_tags (vers->srcfile, vfile, vtag, targc, targv))
!     {
  	freevers_ts (&vers);
  	return (1);
      }
  
      if (vers->srcfile->branch == NULL || inattic ||
! 	strcmp (vers->srcfile->branch, vbranch) != 0)
!     {
  	conflicts++;
  	letter = 'C';
!     }
!     else
  	letter = 'U';
      add_log (letter, vfile);
  
      freevers_ts (&vers);
      return (0);
  }
  
--- 587,609 ----
      /* We may have failed to parse the RCS file; check just in case */
      if (vers->srcfile == NULL ||
  		add_rev (message, vers->srcfile, vfile, vers->vn_rcs) ||
! 		add_tags (vers->srcfile, vfile, vtag, targc, targv)) {
! 
  		freevers_ts (&vers);
  		return (1);
      }
  
      if (vers->srcfile->branch == NULL || inattic ||
! 		strcmp (vers->srcfile->branch, vbranch) != 0) {
  		conflicts++;
  		letter = 'C';
!     } else
  		letter = 'U';
+ 
      add_log (letter, vfile);
  
      freevers_ts (&vers);
+ 
      return (0);
  }
  
***************
*** 607,625 ****
  	locked = 1;
      }
      tocvsPath = wrap_tocvs_process_file (vfile);
!     if (tocvsPath == NULL)
!     {
  	/* We play with hard links rather than passing -u to ci to avoid
  	   expanding RCS keywords (see test 106.5 in sanity.sh).  */
! 	if (link_file (vfile, FILE_HOLDER) < 0)
! 	{
! 	    if (errno == EEXIST)
! 	    {
  		(void) unlink_file (FILE_HOLDER);
  		(void) link_file (vfile, FILE_HOLDER);
! 	    }
! 	    else
! 	    {
  		ierrno = errno;
  		fperror (logfp, 0, ierrno,
  			 "ERROR: cannot create link to %s", vfile);
--- 637,650 ----
  	locked = 1;
      }
      tocvsPath = wrap_tocvs_process_file (vfile);
!     if (tocvsPath == NULL) {
  		/* We play with hard links rather than passing -u to ci to avoid
  		   expanding RCS keywords (see test 106.5 in sanity.sh).  */
! 		if (link_file (vfile, FILE_HOLDER) < 0)	{
! 		    if (errno == EEXIST) {
  				(void) unlink_file (FILE_HOLDER);
  				(void) link_file (vfile, FILE_HOLDER);
! 		    } else {
  				ierrno = errno;
  				fperror (logfp, 0, ierrno,
  					 "ERROR: cannot create link to %s", vfile);
***************
*** 627,657 ****
  		return (1);
  	    }
  	}
      }
  
!     status = RCS_checkin (rcs->path, tocvsPath == NULL ? vfile :
tocvsPath,
! 			  message, vbranch,
  			  (RCS_FLAGS_QUIET
  			   | (use_file_modtime ? RCS_FLAGS_MODTIME : 0)));
      ierrno = errno;
  
-     if (tocvsPath == NULL)
  	rename_file (FILE_HOLDER, vfile);
-     else
- 	if (unlink_file_dir (tocvsPath) < 0)
- 		error (0, errno, "cannot remove %s", tocvsPath);
  
!     if (status)
!     {
! 	if (!noexec)
! 	{
  	    fperror (logfp, 0, status == -1 ? ierrno : 0,
  		     "ERROR: Check-in of %s failed", rcs->path);
  	    error (0, status == -1 ? ierrno : 0,
  		   "ERROR: Check-in of %s failed", rcs->path);
  	}
! 	if (locked)
! 	{
  	    (void) RCS_unlock(rcs, vbranch, 0);
  	}
  	return (1);
--- 652,679 ----
  				return (1);
  		    }
  		}
+     } else {
+ 		rename_file(vfile, FILE_HOLDER);
+ 		rename_file(tocvsPath, vfile);
  	}
  
!     status = RCS_checkin (rcs->path, vfile, message, vbranch,
  			  (RCS_FLAGS_QUIET
  			   | (use_file_modtime ? RCS_FLAGS_MODTIME : 0)));
      ierrno = errno;
  
  	rename_file (FILE_HOLDER, vfile);
  
! 	/*	'ci' removed what was 'tocvsPath' for us					*/
! 
!     if (status) {
! 		if (!noexec) {
  		    fperror (logfp, 0, status == -1 ? ierrno : 0,
  			     "ERROR: Check-in of %s failed", rcs->path);
  		    error (0, status == -1 ? ierrno : 0,
  			   "ERROR: Check-in of %s failed", rcs->path);
  		}
! 		if (locked) {
  		    (void) RCS_unlock(rcs, vbranch, 0);
  		}
  		return (1);
***************
*** 889,905 ****
      if (noexec)
  	return (0);
  
!     if (local_opt == NULL)
!     {
! 	if (wrap_name_has (user, WRAP_RCSOPTION))
! 	{
  	    local_opt = free_opt = wrap_rcsoption (user, 0);
  	}
-     }
  
      tocvsPath = wrap_tocvs_process_file (user);
      userfile = (tocvsPath == NULL ? user : tocvsPath);
      fpuser = CVS_FOPEN (userfile, "r");
      if (fpuser == NULL)
      {
  	/* not fatal, continue import */
--- 911,930 ----
      if (noexec)
  	return (0);
  
! 	/*	wrappers have priority over "default" keyword processing	*/
! 	/**/
! 	if (wrap_name_has (user, WRAP_RCSOPTION)) {
  	    local_opt = free_opt = wrap_rcsoption (user, 0);
      }
  
      tocvsPath = wrap_tocvs_process_file (user);
      userfile = (tocvsPath == NULL ? user : tocvsPath);
+ 	if (local_opt != NULL
+ 	    && (strcmp(local_opt, "b") == 0 || strcmp(local_opt, "o") == 0))
{
+ 	    fpuser = CVS_FOPEN (userfile, "rb");
+ 	} else {
  	    fpuser = CVS_FOPEN (userfile, "r");
+ 	}
      if (fpuser == NULL)
      {
  	/* not fatal, continue import */
Index: CVS_src/src/login.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/login.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 login.c
*** login.c	1997/01/15 16:27:19	1.1.1.1
--- login.c	1997/02/20 15:30:15
***************
*** 162,168 ****
  	/* Check each line to see if we have this entry already. */
  	while (getline (&linebuf, &linebuf_len, fp) >= 0)
          {
!           if (strncmp (CVSroot_original, linebuf, root_len) == 0)
              {
  		already_entered = 1;
  		break;
--- 162,168 ----
  	/* Check each line to see if we have this entry already. */
  	while (getline (&linebuf, &linebuf_len, fp) >= 0)
          {
!           if (FN_STRNCMP (CVSroot_original, linebuf, root_len) == 0)
              {
  		already_entered = 1;
  		break;
***************
*** 195,201 ****
  	    FILE *tmp_fp;
  
  	    tmp_name = cvs_temp_name ();
! 	    if ((tmp_fp = CVS_FOPEN (tmp_name, "w")) == NULL)
              {
  		error (1, errno, "unable to open temp file %s", tmp_name);
  		return 1;
--- 195,201 ----
  	    FILE *tmp_fp;
  
  	    tmp_name = cvs_temp_name ();
! 	    if ((tmp_fp = CVS_FOPEN (tmp_name, FOPEN_BINARY_WRITE)) == NULL)
              {
  		error (1, errno, "unable to open temp file %s", tmp_name);
  		return 1;
***************
*** 215,221 ****
  	    linebuf = (char *) NULL;
  	    while (getline (&linebuf, &linebuf_len, fp) >= 0)
              {
!               if (strncmp (CVSroot_original, linebuf, root_len))
                  fprintf (tmp_fp, "%s", linebuf);
                else
                  fprintf (tmp_fp, "%s %s\n", CVSroot_original,
typed_password);
--- 215,221 ----
  	    linebuf = (char *) NULL;
  	    while (getline (&linebuf, &linebuf_len, fp) >= 0)
              {
!               if (FN_STRNCMP (CVSroot_original, linebuf, root_len))
                  fprintf (tmp_fp, "%s", linebuf);
                else
                  fprintf (tmp_fp, "%s %s\n", CVSroot_original,
typed_password);
***************
*** 233,239 ****
      }
      else
      {
! 	if ((fp = CVS_FOPEN (passfile, "a")) == NULL)
          {
  	    error (1, errno, "could not open %s", passfile);
  	    free (passfile);
--- 233,239 ----
      }
      else
      {
! 	if ((fp = CVS_FOPEN (passfile, FOPEN_BINARY_APPEND)) == NULL)
          {
  	    error (1, errno, "could not open %s", passfile);
  	    free (passfile);
***************
*** 319,325 ****
    /* Check each line to see if we have this entry already. */
    while (getline (&linebuf, &linebuf_len, fp) >= 0)
      {
!       if (strncmp (CVSroot_original, linebuf, root_len) == 0)
          {
            /* This is it!  So break out and deal with linebuf. */
            found_it = 1;
--- 319,325 ----
    /* Check each line to see if we have this entry already. */
    while (getline (&linebuf, &linebuf_len, fp) >= 0)
      {
!       if (FN_STRNCMP (CVSroot_original, linebuf, root_len) == 0)
          {
            /* This is it!  So break out and deal with linebuf. */
            found_it = 1;
Index: CVS_src/src/main.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/main.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 main.c
*** main.c	1997/01/15 16:27:19	1.1.1.1
--- main.c	1997/02/20 15:30:15
***************
*** 625,631 ****
  #ifdef CLIENT_SUPPORT
  		         !getenv ("CVS_IGNORE_REMOTE_ROOT") &&
  #endif
! 			 strcmp (CVSroot, CVSADM_Root) != 0)
  		{
  		    /* Once we have verified that this root is usable,
  		       we will want to write it into CVS/Root.
--- 625,631 ----
  #ifdef CLIENT_SUPPORT
  		         !getenv ("CVS_IGNORE_REMOTE_ROOT") &&
  #endif
! 			 FN_STRCMP (CVSroot, CVSADM_Root) != 0)
  		{
  		    /* Once we have verified that this root is usable,
  		       we will want to write it into CVS/Root.
Index: CVS_src/src/mkmodules.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/mkmodules.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 mkmodules.c
*** mkmodules.c	1997/01/15 16:27:19	1.1.1.1
--- mkmodules.c	1997/02/19 15:50:31
***************
*** 255,260 ****
--- 255,263 ----
      {CVSROOTADM_IGNORE,
  	"a %s file can be used to specify files to ignore",
  	NULL},
+     {CVSROOTADM_USERS,
+ 	"a %s file can be used to specify mappings from user names to
notification email addresses",
+ 	NULL},
      {CVSROOTADM_CHECKOUTLIST,
  	"a %s file can specify extra CVSROOT files to auto-checkout",
  	checkoutlist_contents},
***************
*** 364,371 ****
  	    if (line[0] == '#')
  		continue;
  
! 	    if ((last = strrchr (line, '\n')) != NULL)
  		*last = '\0';			/* strip the newline */
  
  	    /* Skip leading white space. */
  	    for (fname = line; *fname && isspace(*fname); fname++)
--- 367,379 ----
  	    if (line[0] == '#')
  		continue;
  
! 	    if ((last = strrchr (line, '\n')) != NULL) {
  			*last = '\0';	   	/* strip the newline 			*/
+ 			if (last > line && *(last - 1) == '\r') {	/*	on DOS, strip the CR,
too	*/
+ 				last--;
+ 				*last = '\0';
+ 			}
+ 		}
  
  	    /* Skip leading white space. */
  	    for (fname = line; *fname && isspace(*fname); fname++)
***************
*** 461,468 ****
  	error (1, errno, "cannot open dbm file %s for creation", temp);
      for (cont = 0; fgets (line, sizeof (line), fp) != NULL;)
      {
! 	if ((cp = strrchr (line, '\n')) != NULL)
  	    *cp = '\0';			/* strip the newline */
  
  	/*
  	 * Add the line to the value, at the end if this is a continuation
--- 469,481 ----
  	error (1, errno, "cannot open dbm file %s for creation", temp);
      for (cont = 0; fgets (line, sizeof (line), fp) != NULL;)
      {
! 	if ((cp = strrchr (line, '\n')) != NULL) {
  	    *cp = '\0';			/* strip the newline */
+ 		if (cp > line && *(cp - 1) == '\r') {	/*	on DOS, strip the CR,
too	*/
+ 			cp--;
+ 			*cp = '\0';
+ 		}
+ 	}
  
  	/*
  	 * Add the line to the value, at the end if this is a continuation
Index: CVS_src/src/parseinfo.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/parseinfo.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 parseinfo.c
*** parseinfo.c	1997/01/15 16:27:20	1.1.1.1
--- parseinfo.c	1997/02/19 15:50:33
***************
*** 90,97 ****
  	value = cp;
  
  	/* strip the newline off the end of the value */
! 	if ((cp = strrchr (value, '\n')) != NULL)
  	    *cp = '\0';
  
  	expanded_value = expand_path (value, infofile, line_number);
  	if (!expanded_value)
--- 90,102 ----
  	value = cp;
  
  	/* strip the newline off the end of the value */
! 	if ((cp = strrchr (value, '\n')) != NULL) {
  	    *cp = '\0';
+ 		if (cp > value && *(cp - 1) == '\r') {	/*	on DOS, strip the CR,
too	*/
+ 			cp--;
+ 			*cp = '\0';
+ 		}
+ 	}
  
  	expanded_value = expand_path (value, infofile, line_number);
  	if (!expanded_value)
Index: CVS_src/src/patch.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/patch.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 patch.c
*** patch.c	1997/01/15 16:27:20	1.1.1.1
--- patch.c	1997/02/19 15:50:33
***************
*** 430,442 ****
  	return (0);
      }
      tmpfile1 = cvs_temp_name ();
!     if ((fp1 = CVS_FOPEN (tmpfile1, "w+")) != NULL)
  	(void) fclose (fp1);
      tmpfile2 = cvs_temp_name ();
!     if ((fp2 = CVS_FOPEN (tmpfile2, "w+")) != NULL)
  	(void) fclose (fp2);
      tmpfile3 = cvs_temp_name ();
!     if ((fp3 = CVS_FOPEN (tmpfile3, "w+")) != NULL)
  	(void) fclose (fp3);
      if (fp1 == NULL || fp2 == NULL || fp3 == NULL)
      {
--- 430,442 ----
  	return (0);
      }
      tmpfile1 = cvs_temp_name ();
!     if ((fp1 = CVS_FOPEN (tmpfile1, FOPEN_BINARY_UPDATE)) != NULL)
  	(void) fclose (fp1);
      tmpfile2 = cvs_temp_name ();
!     if ((fp2 = CVS_FOPEN (tmpfile2, FOPEN_BINARY_UPDATE)) != NULL)
  	(void) fclose (fp2);
      tmpfile3 = cvs_temp_name ();
!     if ((fp3 = CVS_FOPEN (tmpfile3, FOPEN_BINARY_UPDATE)) != NULL)
  	(void) fclose (fp3);
      if (fp1 == NULL || fp2 == NULL || fp3 == NULL)
      {
***************
*** 484,490 ****
--- 484,494 ----
  						    (char *) 0, 0)) != -1)
  		(void) utime (tmpfile2, &t);
      }
+ #if !defined(_WIN32)
      run_setup ("%s -%c", DIFF, unidiff ? 'u' : 'c');
+ #else	/* !defined(_WIN32) */
+     run_setup ("%s --binary -%c", DIFF, unidiff ? 'u' : 'c');
+ #endif	/* !defined(_WIN32) */
      run_arg (tmpfile1);
      run_arg (tmpfile2);
  
***************
*** 560,566 ****
  	    }
  	    else
  	    {
! 		(void) strcpy (file1, DEVNULL);
  	    }
  	    (void) sprintf (file2, "%s:%s", finfo->fullname,
  			    vers_head ? vers_head : "removed");
--- 564,570 ----
  	    }
  	    else
  	    {
! 		(void) strcpy (file1, DEVNULL_IN);
  	    }
  	    (void) sprintf (file2, "%s:%s", finfo->fullname,
  			    vers_head ? vers_head : "removed");
Index: CVS_src/src/rcs.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/rcs.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 rcs.c
*** rcs.c	1997/01/15 16:27:20	1.1.1.1
--- rcs.c	1997/02/19 15:50:33
***************
*** 602,610 ****
  			    error (1, 0, "space expected in %s",
  				   rcs->path);
  			count = strtoul (cp, (char **) &cp, 10);
! 			if (*cp++ != '\012')
! 			    error (1, 0, "linefeed expected in %s",
! 				   rcs->path);
  
  			if (op == 'd')
  			    del += count;
--- 602,614 ----
  			    error (1, 0, "space expected in %s",
  				   rcs->path);
  			count = strtoul (cp, (char **) &cp, 10);
! 			if (*cp != '\012') {
! 				if (*cp == '\015' && *(cp+1) == '\012')
! 					cp += 2;
! 				else
! 				    error (1, 0, "linefeed expected in %s", rcs->path);
! 			} else
! 				cp++;
  
  			if (op == 'd')
  			    del += count;
***************
*** 2967,2975 ****
  			    error (1, 0, "number expected in %s",
  				   rcs->path);
  			p = q;
! 			if (*p++ != '\012')
! 			    error (1, 0, "linefeed expected in %s",
! 				   rcs->path);
  
  			if (op == 'a')
  			{
--- 2971,2983 ----
  			    error (1, 0, "number expected in %s",
  				   rcs->path);
  			p = q;
! 			if (*p != '\012') {
! 				if (*p == '\015' && *(p+1) == '\012')
! 					p += 2;
! 				else
! 			    	error (1, 0, "linefeed expected in %s", rcs->path);
! 			} else
! 				p++;
  
  			if (op == 'a')
  			{
Index: CVS_src/src/recurse.c
===================================================================
RCS file:
s:/Software/AWC_Tools/CVSROOT/CVS_src/src/recurse.c,vretrieving revision
1.1.1.1
diff -c -w -r1.1.1.1 recurse.c
*** recurse.c	1997/01/15 16:27:20	1.1.1.1
--- recurse.c	1997/02/19 15:50:33
***************
*** 339,344 ****
--- 339,351 ----
  	server_pause_check();
  #endif
  
+ 	if (trace) {
+ 		char cwdbuf[100];
+ 
+ 		getcwd(cwdbuf, 100);
+ 		(void) fprintf (stderr, "-> do_recursion: cwd = %s\n", cwdbuf);
+ 	}
+ 
      /*
       * Fill in repository with the current repository
       */
***************
*** 395,406 ****
--- 402,440 ----
  	    if (repository == NULL)
  		repository = Name_Repository ((char *) NULL, update_dir);
  
+ 		if (trace) {
+ 			char cwdbuf[100];
+ 
+ 			getcwd(cwdbuf, 100);
+ 			(void) fprintf (stderr, "-> do_recursion (about to Find_Names): cwd
= %s\n", cwdbuf);
+ 		}
+ 		
  	    /* find the files and fill in entries if appropriate */
  	    filelist = Find_Names (repository, lwhich, frame->aflag,
&entries);
+ 
+ 		if (trace) {
+ 			if (filelist != NULL) {
+ 				Node *head, *p;
+ 
+ 				head = filelist->list;
+ 				for (p = head->next; p != head; p = p->next) {
+ 					(void) fprintf (stderr, "-> do_recursion (after Find_Names): name
= %s\n", p->key);
+ 				}	/* for (p = head->next; p != head; p = p->next) */
+ 			} else {	/* if (filelist != NULL) */
+ 				(void) fprintf (stderr, "-> do_recursion (after Find_Names): no
names!");
+ 			}
+ 		}
  	}
  
  	/* find sub-directories if we will recurse */
  	if (frame->flags != R_SKIP_DIRS)
+ 		if (trace) {
+ 			char cwdbuf[100];
+ 
+ 			getcwd(cwdbuf, 100);
+ 			(void) fprintf (stderr, "-> do_recursion (about to
Find_Directories): cwd = %s\n", cwdbuf);
+ 		}
+ 
  	    dirlist = Find_Directories (repository, frame->which, entries);
      }
      else
Index: CVS_src/src/release.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/release.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 release.c
*** release.c	1997/01/15 16:27:20	1.1.1.1
--- release.c	1997/02/19 15:50:33
***************
*** 45,51 ****
      FILE *fp;
      register int i, c;
      char *repository, *srepos;
!     char line[PATH_MAX], update_cmd[PATH_MAX];
      char *thisarg;
      int arg_start_idx;
      int err = 0;
--- 45,51 ----
      FILE *fp;
      register int i, c;
      char *repository, *srepos;
!     char line[PATH_MAX], update_cmd[PATH_MAX], cmd_cwd[PATH_MAX];
      char *thisarg;
      int arg_start_idx;
      int err = 0;
***************
*** 137,142 ****
--- 137,147 ----
           */
          if (isdir (thisarg))
          {
+ 			getcwd(cmd_cwd, PATH_MAX);
+ 			if (trace)
+ 				(void) fprintf (stderr, "-> release: cwd = %s\n", cmd_cwd);
+ 				
+ 
            if ( CVS_CHDIR (thisarg) < 0)
            {
              if (!really_quiet)
***************
*** 241,247 ****
  #endif /* CLIENT_SUPPORT */
          
          free (repository);
!         if (delete_flag) release_delete (thisarg);
          
  #ifdef CLIENT_SUPPORT
          if (client_active)
--- 246,255 ----
  #endif /* CLIENT_SUPPORT */
          
          free (repository);
!         if (delete_flag) {
!         	CVS_CHDIR (cmd_cwd);
!         	release_delete (thisarg);
! 		}
          
  #ifdef CLIENT_SUPPORT
          if (client_active)
***************
*** 267,272 ****
--- 275,284 ----
      struct stat st;
      ino_t ino;
  
+ 	if (trace)
+ 		(void) fprintf (stderr, "-> release_delete(%s)\n", dir);
+ 
+ #if 0
      (void) CVS_STAT (".", &st);
      ino = st.st_ino;
      (void) CVS_CHDIR ("..");
***************
*** 277,282 ****
--- 289,295 ----
  	       "Parent dir on a different disk, delete of %s aborted", dir);
  	return;
      }
+ #endif
      /*
       * XXX - shouldn't this just delete the CVS-controlled files and,
perhaps,
       * the files that would normally be ignored and leave everything
else?
Index: CVS_src/src/repos.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/repos.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 repos.c
*** repos.c	1997/01/15 16:27:20	1.1.1.1
--- repos.c	1997/02/20 15:30:15
***************
*** 77,84 ****
  	error (1, errno, "cannot read %s", CVSADM_REP);
      }
      (void) fclose (fpin);
!     if ((cp = strrchr (repos, '\n')) != NULL)
  	*cp = '\0';			/* strip the newline */
  
      /*
       * If this is a relative repository pathname, turn it into an
absolute
--- 77,89 ----
  	error (1, errno, "cannot read %s", CVSADM_REP);
      }
      (void) fclose (fpin);
!     if ((cp = strrchr (repos, '\n')) != NULL) {
  		*cp = '\0';			/* strip the newline */
+ 		if (cp > repos && *(cp-1) == '\r') {	/*	on DOS, strip the CR, as
well */
+ 			--cp;
+ 			*cp = '\0';
+ 		}
+ 	}
  
      /*
       * If this is a relative repository pathname, turn it into an
absolute
***************
*** 123,129 ****
  
      /* If repository matches CVSroot at the beginning, strip off
CVSroot */
      /* And skip leading '/' in rep, in case CVSroot ended with '/'. */
!     if (strncmp (CVSroot_directory, repository,
  		 strlen (CVSroot_directory)) == 0)
      {
  	char *rep = repository + strlen (CVSroot_directory);
--- 128,134 ----
  
      /* If repository matches CVSroot at the beginning, strip off
CVSroot */
      /* And skip leading '/' in rep, in case CVSroot ended with '/'. */
!     if (FN_STRNCMP (CVSroot_directory, repository,
  		 strlen (CVSroot_directory)) == 0)
      {
  	char *rep = repository + strlen (CVSroot_directory);
Index: CVS_src/src/root.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/root.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 root.c
*** root.c	1997/01/15 16:27:20	1.1.1.1
--- root.c	1997/02/19 15:50:33
***************
*** 75,82 ****
  	return (NULL);
      }
      (void) fclose (fpin);
!     if ((cp = strrchr (root, '\n')) != NULL)
  	*cp = '\0';			/* strip the newline */
  
      /*
       * root now contains a candidate for CVSroot. It must be an
--- 75,87 ----
  	return (NULL);
      }
      (void) fclose (fpin);
!     if ((cp = strrchr (root, '\n')) != NULL) {
  		*cp = '\0';			/* strip the newline */
+ 		if (cp > root && *(cp-1) == '\r') {	/*	on DOS, strip the CR, as well
*/
+ 			--cp;
+ 			*cp = '\0';
+ 		}
+ 	}
  
      /*
       * root now contains a candidate for CVSroot. It must be an
Index: CVS_src/src/server.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/server.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 server.c
*** server.c	1997/01/15 16:27:21	1.1.1.1
--- server.c	1997/02/20 15:30:15
***************
*** 612,618 ****
         of the Repository file, so we do the same.  */
      if (strcmp (dir, ".") == 0
  	&& CVSroot_directory != NULL
! 	&& strcmp (CVSroot_directory, repos) == 0)
      {
          if (fprintf (f, "/.") < 0)
  	{
--- 612,618 ----
         of the Repository file, so we do the same.  */
      if (strcmp (dir, ".") == 0
  	&& CVSroot_directory != NULL
! 	&& FN_STRCMP (CVSroot_directory, repos) == 0)
      {
          if (fprintf (f, "/.") < 0)
  	{
***************
*** 2963,2969 ****
      }
      else if (scratched_file != NULL && entries_line == NULL)
      {
! 	if (strcmp (scratched_file, finfo->file) != 0)
  	    error (1, 0,
  		   "CVS server internal error: `%s' vs. `%s' scratched",
  		   scratched_file,
--- 2963,2969 ----
      }
      else if (scratched_file != NULL && entries_line == NULL)
      {
! 	if (FN_STRCMP (scratched_file, finfo->file) != 0)
  	    error (1, 0,
  		   "CVS server internal error: `%s' vs. `%s' scratched",
  		   scratched_file,
Index: CVS_src/src/subr.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/subr.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 subr.c
*** subr.c	1997/01/15 16:27:21	1.1.1.1
--- subr.c	1997/02/19 15:50:35
***************
*** 79,85 ****
    int len;
    len = strlen (str) - 1;
  
!   while (str[len] == '\n')
      str[len--] = '\0';
  }
  
--- 79,85 ----
    int len;
    len = strlen (str) - 1;
  
!   while (str[len] == '\n' || str[len] == '\r')	/*	on DOS, also strip
CR	*/
      str[len--] = '\0';
  }
  
***************
*** 152,166 ****
      uid_t uid;
  
      uid = getuid ();
!     if (uid == (uid_t) 0)
!     {
  	/* super-user; try getlogin() to distinguish */
  	if (((name = getlogin ()) || (name = getenv("LOGNAME")) ||
! 	     (name = getenv("USER"))) && *name)
  	    return (name);
      }
!     if ((pw = (struct passwd *) getpwuid (uid)) == NULL)
!     {
  	(void) sprintf (uidname, "uid%lu", (unsigned long) uid);
  	return (uidname);
      }
--- 152,172 ----
      uid_t uid;
  
      uid = getuid ();
!     if (uid == (uid_t) 0) {
  		/* super-user; try getlogin() to distinguish */
  		if (((name = getlogin ()) || (name = getenv("LOGNAME")) ||
! 		     (name = getenv("USER")) ||
! 		     (name = getenv("USERNAME"))) && *name)
  		    return (name);
      }
!     if ((pw = (struct passwd *) getpwuid (uid)) == NULL) {
! #if defined(_WIN32)
! 		if (((name = getlogin ()) || (name = getenv("LOGNAME")) ||
! 		     (name = getenv("USER")) ||
! 		     (name = getenv("USERNAME"))) && *name)
! 		    return (name);
! #endif
! 
  		(void) sprintf (uidname, "uid%lu", (unsigned long) uid);
  		return (uidname);
      }
Index: CVS_src/src/tag.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/tag.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 tag.c
*** tag.c	1997/01/15 16:27:21	1.1.1.1
--- tag.c	1997/02/20 15:30:15
***************
*** 650,656 ****
  {
      if (repository != NULL
  	&& (locked_dir == NULL
! 	    || strcmp (locked_dir, repository) != 0))
      {
          Node *node;
  
--- 650,656 ----
  {
      if (repository != NULL
  	&& (locked_dir == NULL
! 	    || FN_STRCMP (locked_dir, repository) != 0))
      {
          Node *node;
  
Index: CVS_src/src/update.c
===================================================================
RCS file: s:/Software/AWC_Tools/CVSROOT/CVS_src/src/update.c,v
retrieving revision 1.1.1.1
diff -c -w -r1.1.1.1 update.c
*** update.c	1997/01/15 16:27:21	1.1.1.1
--- update.c	1997/02/20 15:30:15
***************
*** 837,844 ****
  	repository = Name_Repository ((char *) NULL, update_dir);
  	if (fgets (line, sizeof (line), fp) != NULL)
  	{
! 	    if ((cp = strrchr (line, '\n')) != NULL)
  		*cp = '\0';
  	    run_setup ("%s %s", line, repository);
  	    (void) printf ("%s %s: Executing '", program_name, command_name);
  	    run_print (stdout);
--- 837,849 ----
  	repository = Name_Repository ((char *) NULL, update_dir);
  	if (fgets (line, sizeof (line), fp) != NULL)
  	{
! 	    if ((cp = strrchr (line, '\n')) != NULL) {
  			*cp = '\0';
+ 			if (cp > line && *(cp-1) == '\r') {	/*	on DOS, strip the CR, as
well */
+ 				--cp;
+ 				*cp = '\0';
+ 			}
+ 		}
  	    run_setup ("%s %s", line, repository);
  	    (void) printf ("%s %s: Executing '", program_name, command_name);
  	    run_print (stdout);
***************
*** 886,893 ****
      }
      while ((dp = readdir (dirp)) != NULL)
      {
! 	if (strcmp (dp->d_name, ".") != 0 && strcmp (dp->d_name, "..") != 0
&&
! 	    strcmp (dp->d_name, CVSADM) != 0)
  	{
  	    (void) closedir (dirp);
  	    return (0);
--- 891,899 ----
      }
      while ((dp = readdir (dirp)) != NULL)
      {
! 	if (strlen(dp->d_name) != 0 &&	/* bypass cygwin.dll rel. b17 bug */
! 		strcmp (dp->d_name, ".") != 0 && strcmp (dp->d_name, "..") != 0 &&
! 	    FN_STRCMP (dp->d_name, CVSADM) != 0)
  	{
  	    (void) closedir (dirp);
  	    return (0);
***************
*** 1215,1221 ****
--- 1221,1231 ----
  	   deltas or something equivalent.  */
  	/* This is -c, not -u, because we have no way of knowing which
  	   DIFF is in use.  */
+ #if !defined(_WIN32)
	run_setup ("%s -c %s %s", DIFF, file1, file2);
+ #else	/* !defined(_WIN32) */
+	run_setup ("%s --binary -c %s %s", DIFF, file1, file2);
+ #endif	/* !defined(_WIN32) */
  
  	/* A retcode of 0 means no differences.  1 means some differences.
*/
  	if ((retcode = run_exec (RUN_TTY, finfo->file, RUN_TTY, RUN_NORMAL))
!= 0

*** CVS_src/config.h	Thu Feb 27 13:28:31 1997
--- CVS_src/config.Aironet.h	Wed Feb 19 10:50:09 1997
***************
*** 61,67 ****
  /* #undef HAVE_KERBEROS */
  
  /* Define if you want CVS to be able to be a remote repository client.
 */
! /* #undef CLIENT_SUPPORT */
  
  /* Define if you want CVS to be able to serve repositories to remote
     clients.  */
--- 61,67 ----
  /* #undef HAVE_KERBEROS */
  
  /* Define if you want CVS to be able to be a remote repository client.
 */
! #define CLIENT_SUPPORT
  
  /* Define if you want CVS to be able to serve repositories to remote
     clients.  */
***************
*** 219,221 ****
--- 219,265 ----
  
  /* Define if you have the socket library (-lsocket).  */
  /* #undef HAVE_LIBSOCKET */
+ 
+ /* Under Windows NT, filenames are case-insensitive, and both / and \
+    are path component separators.  */
+ #define FOLD_FN_CHAR(c) (WNT_filename_classes[(unsigned char) (c)])
+ extern unsigned char WNT_filename_classes[];
+ #define FILENAMES_CASE_INSENSITIVE 1
+ 
+ /* Is the character C a path name separator?  Under
+    Windows NT, you can use either / or \.  */
+ #define ISDIRSEP(c) (FOLD_FN_CHAR(c) == '/')
+ 
+ /* Like strcmp, but with the appropriate tweaks for file names.
+    Under Windows NT, filenames are case-insensitive but
case-preserving,
+    and both \ and / are path element separators.  */
+ extern int fncmp (const char *n1, const char *n2);
+ 
+ /* Fold characters in FILENAME to their canonical forms.  
+    If FOLD_FN_CHAR is not #defined, the system provides a default
+    definition for this.  */
+ extern void fnfold (char *FILENAME);
+ 
+ /* #define this if your system terminates lines in text files with
+    CRLF instead of plain LF, and your I/O functions automatically
+    translate between using LF in memory and CRLF on disk, unless you
+    specifically tell them not to.  */
+ #define LINES_CRLF_TERMINATED 1
+ 
+ /* Read data from INFILE, and copy it to OUTFILE. 
+    Open INFILE using INFLAGS, and OUTFILE using OUTFLAGS.
+    This is useful for converting between CRLF and LF line formats.  */
+ extern void convert_file (char *INFILE,  int INFLAGS,
+ 			  char *OUTFILE, int OUTFLAGS);
+ 
+ /* Try to avoid cygwin32 bash's remapping of drive letters into
rooted	*/
+ /* directory names.														*/
+ #define getwd dosNormGetwd
+ extern char* dosNormGetwd(char* cwdBuf);
+ 
+ /* This is where old bits go to die under Windows NT.  */
+ #define DEVNULL "nul"
+ #define DEVNULL_IN DEVNULL
+ #define DEVNULL_OUT DEVNULL
+ 
+ #define HAVE_RCS5

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".