*** lib/xdirent.h~0	Tue Jul  9 04:20:54 1996
--- lib/xdirent.h	Sat Jan 25 16:43:02 1997
***************
*** 34,50 ****
  
  /* Interpret `HAVE_LINK' as meaning `UN*X style' directory structure
     (e.g., A single root called `/', with `/' separating links), and
!    !HAVE_LINK as `DOS|OS/2|Windows style' (e.g., Multiple root volues
     named `x:', with `\' separating links).  */
  
  #if HAVE_LINK
! # define IS_ABSOLUTE(_dir_) ((_dir_)[0] == '/')
! # define SLASH_STRING "/"
! # define SLASH_CHAR '/'
! # define DOT_DOT_SLASH "../"
  #else
  /* NEEDSWORK: prefer forward-slashes as a user-configurable option.  */
! # define IS_ABSOLUTE(_dir_) ((_dir_)[1] == ':')
  # define SLASH_STRING "\\/"
  # define SLASH_CHAR '\\'
  # define DOT_DOT_SLASH "..\\"
--- 34,76 ----
  
  /* Interpret `HAVE_LINK' as meaning `UN*X style' directory structure
     (e.g., A single root called `/', with `/' separating links), and
!    !HAVE_LINK as `DOS|OS/2|Windows style' (e.g., Multiple root volumes
     named `x:', with `\' separating links).  */
  
  #if HAVE_LINK
! # ifdef __DJGPP__
! /* DJGPP has `link' in libc and prefers forward slashes, but
!    also has DOS-style directory structure.  It also makes sense
!    to include the link-related code in the DJGPP version, since
!    SUBST'ed and JOIN'ed drives behave on MS-DOS exactly like
!    links on UN*X, i.e. they create alias names for the same files.
!    The DJGPP version of `stat' will return the same inode for
!    such aliases.  */
! #  define DRIVE_LETTER_IN_PATH 1
! #  define PATH_SEP ";"
! #  define IS_ABSOLUTE(_dir_) ((_dir_)[0] && (_dir_)[1] == ':')
! #  define SLASH_STRING "/\\"
! #  define SLASH_CHAR '/'
! #  define DOT_DOT_SLASH "../"
! #  define MAKE_PATH_EXPLICIT(_path_) \
! 	  do { \
! 	       char *expath = ALLOCA (char, PATH_MAX); \
! 	       _fixpath (_path_, expath); \
! 	       _path_ = expath; \
! 	     } while (0)
! # else
! #  define DRIVE_LETTER_IN_PATH 0
! #  define PATH_SEP ":"
! #  define IS_ABSOLUTE(_dir_) ((_dir_)[0] == '/')
! #  define SLASH_STRING "/"
! #  define SLASH_CHAR '/'
! #  define DOT_DOT_SLASH "../"
! # endif
  #else
  /* NEEDSWORK: prefer forward-slashes as a user-configurable option.  */
! # define DRIVE_LETTER_IN_PATH 1
! # define PATH_SEP ";"
! # define IS_ABSOLUTE(_dir_) ((_dir_)[0] && (_dir_)[1] == ':')
  # define SLASH_STRING "\\/"
  # define SLASH_CHAR '\\'
  # define DOT_DOT_SLASH "..\\"
*** libidu/idfile.c~0	Tue Jul  9 04:19:08 1996
--- libidu/idfile.c	Sat Jan 25 13:28:30 1997
***************
*** 25,30 ****
--- 25,31 ----
  #include "xsysstat.h"
  #include "xnls.h"
  #include "xobstack.h"
+ #include "xdirent.h"
  #include "idfile.h"
  #include "error.h"
  
*************** locate_id_file_name (char const *arg)
*** 54,60 ****
        if (id_path)
  	{
  	  id_path = strdup (id_path);
! 	  arg = strtok (id_path, ":");
  	  /* FIXME: handle multiple ID file names */
  	}
      }
--- 55,61 ----
        if (id_path)
  	{
  	  id_path = strdup (id_path);
! 	  arg = strtok (id_path, PATH_SEP);
  	  /* FIXME: handle multiple ID file names */
  	}
      }
*************** locate_id_file_name (char const *arg)
*** 62,70 ****
      arg = DEFAULT_ID_FILE_NAME;
  
    /* if we got absolute name, just use it. */
!   if (arg[0] == '/')
      return arg;
!   /* if the name we were give exists, don't bother searching */
    if (stat (arg, &statb) == 0)
      return arg;
    /* search up the tree until we find a directory where this
--- 63,76 ----
      arg = DEFAULT_ID_FILE_NAME;
  
    /* if we got absolute name, just use it. */
!   if (IS_ABSOLUTE (arg))
      return arg;
! #if DRIVE_LETTER_IN_PATH
!   /* IS_ABSOLUTE doesn't include the case of "/path", for efficiency.  */
!   if (arg[0] && strchr (SLASH_STRING, arg[0]))
!     return arg;
! #endif
!   /* if the name we were given exists, don't bother searching */
    if (stat (arg, &statb) == 0)
      return arg;
    /* search up the tree until we find a directory where this
*** libidu/idread.c~0	Wed Jul 17 21:55:46 1996
--- libidu/idread.c	Sat Jan 25 13:08:56 1997
*************** struct file_link **
*** 55,61 ****
  maybe_read_id_file (char const *id_file_name, struct idhead *idhp)
  {
    obstack_init (&idhp->idh_file_link_obstack);
!   idhp->idh_FILE = fopen (id_file_name, "r");
    if (idhp->idh_FILE == 0)
      return 0;
  
--- 55,61 ----
  maybe_read_id_file (char const *id_file_name, struct idhead *idhp)
  {
    obstack_init (&idhp->idh_file_link_obstack);
!   idhp->idh_FILE = fopen (id_file_name, "rb");
    if (idhp->idh_FILE == 0)
      return 0;
  
*** libidu/scanners.c~0	Wed Jul 17 21:45:52 1996
--- libidu/scanners.c	Sat Feb 15 12:44:16 1997
***************
*** 33,38 ****
--- 33,43 ----
  #include "error.h"
  #include "scanners.h"
  #include "tokflags.h"
+ #include "pathmax.h"
+ 
+ #ifndef O_BINARY
+ # define O_BINARY 0
+ #endif
  
  #define DEBUG(args) /* printf args */
  
*************** static void help_me_text __P((void));
*** 65,70 ****
--- 70,76 ----
  struct language languages_0[] =
  {
    { "C", parse_args_c, get_token_c, help_me_c },
+   { "C++", parse_args_c, get_token_c, help_me_c },
    { "asm", parse_args_asm, get_token_asm, help_me_asm },
    { "text", parse_args_text, get_token_text, help_me_text },
  };
*************** read_language_map_file (char const *file
*** 251,257 ****
    struct stat st;
    int bytes;
  
!   map_fd = open (file_name, O_RDONLY);
    if (map_fd < 0)
      error (1, errno, _("can't open language map file `%s'"), file_name);
    if (fstat (map_fd, &st) < 0)
--- 257,303 ----
    struct stat st;
    int bytes;
  
!   map_fd = open (file_name, O_RDONLY | O_BINARY);
!   if (map_fd < 0)
!     {
!       /* Allow `file_name' to include a reference to environment,
! 	 like in d:/lib/$(VAR)/dir/file.  This is primarily for
! 	 those systems where there are no standardized directories
! 	 to keep data files (like MS-DOS), and therefore a built-in
! 	 compile-time default might not exist at run time when the
! 	 binary is moved to another installation.  MS-DOS users
! 	 aren't used to build everything from sources on each machine.  */
!       char *env_ref, *env_end;
!       char *paren_ref = strstr (file_name, "$(");
!       char *brace_ref = strstr (file_name, "${");
!       int   end_char = ')';
! 
!       env_ref = paren_ref;
!       if (!env_ref)
! 	{
! 	  env_ref  = brace_ref;
! 	  end_char = '}';
! 	}
!       if (env_ref && (env_end = strchr (env_ref, end_char)) != 0)
! 	{
! 	  char *ep;
! 	  char ename[PATH_MAX];
! 
! 	  /* Replace the variable reference by its value, but leave alone
! 	     what's before and after it.  */
! 	  env_ref += 2;
! 	  ename[0] = '\0';
! 	  strncat (ename, env_ref, env_end - env_ref);
! 	  if ((ep = getenv (ename)) != 0)
! 	    {
! 	      ename[0] = '\0';
! 	      strncat (ename, file_name, env_ref - 2 - file_name);
! 	      strcat (ename, ep);
! 	      strcat (ename, env_end + 1);
! 	      map_fd = open (ename, O_RDONLY | O_BINARY);
! 	    }
! 	}
!     }
    if (map_fd < 0)
      error (1, errno, _("can't open language map file `%s'"), file_name);
    if (fstat (map_fd, &st) < 0)
*** libidu/walker.c~0	Wed Jul 17 20:43:40 1996
--- libidu/walker.c	Sat Feb 15 18:20:46 1997
*************** static char white_space[] = " \t\r\n\v\f
*** 81,86 ****
--- 81,94 ----
  
  char* xgetcwd __P((void));
  
+ #if DRIVE_LETTER_IN_PATH
+ #include <ctype.h>
+ #define MAX_DRIVES 32
+ static char *drive_cwd[MAX_DRIVES]; /* original CWD for drives where we walk */
+ static int  orig_drive_idx = -1;    /* index of drive where we begin */
+ static void restore_cwds __P((void));
+ #endif
+ 
  
  /****************************************************************************/
  /* Walk the file-system tree rooted at `dir_link', looking for files
*************** parse_file_name (char *file_name, struct
*** 516,528 ****
    char **links_0;
    char **links;
  
!   if (IS_ABSOLUTE (file_name))
!     {
! #if HAVE_LINK
!       flink = get_link_from_string (SLASH_STRING, 0);
  #else
!       flink = 0;
  #endif
      }
    else if (relative_dir_link)
      flink = relative_dir_link;
--- 524,561 ----
    char **links_0;
    char **links;
  
! #if DRIVE_LETTER_IN_PATH
!   /* The functions which handle `file_link's assume that on non-Un*x
!      filesystems the drive and the root directory on the drive are
!      always explicit in absolute filenames, i.e., they expect to see
!      "d:/root/dir/path", but not "/root/dir/path" or "d:path".  We need
!      to make the drive and/or root directory explicit in "/path" and
!      "x:path", so these assumptions in the rest of code are true.  */
!   if ((file_name[0] && strchr (SLASH_STRING, file_name[0]))
!       || (IS_ABSOLUTE (file_name)
! 	  && (file_name[2] == '\0' || !strchr (SLASH_STRING, file_name[2]))))
! #ifdef MAKE_PATH_EXPLICIT
!     MAKE_PATH_EXPLICIT (file_name);
  #else
! #error MAKE_PATH_EXPLICIT needed, but not defined!
! #endif
  #endif
+ 
+   if (IS_ABSOLUTE (file_name))
+     {
+       /* Make `struct file_link' for the root directory.  */
+       char root_string[4];	/* "x:/" needs 4 chars, "/" needs 2 */
+       char *root_dir = strpbrk (file_name, SLASH_STRING);
+ 
+       if (root_dir)
+ 	{
+ 	  root_string[0] = '\0';
+ 	  strncat (root_string, file_name, root_dir - file_name + 1);
+ 	  flink = get_link_from_string (root_string, 0);
+ 	  flink->fl_flags = (flink->fl_flags & ~FL_TYPE_MASK) | FL_TYPE_DIR;
+ 	}
+       else
+ 	flink = 0;
      }
    else if (relative_dir_link)
      flink = relative_dir_link;
*************** get_current_dir_link (void)
*** 579,590 ****
    if (cwd_0 == 0)
      error (1, errno, _("can't get working directory"));
    cwd = cwd_0;
! #if HAVE_LINK
!   dir_link = get_link_from_string (SLASH_STRING, 0);
!   dir_link->fl_flags = (dir_link->fl_flags & ~FL_TYPE_MASK) | FL_TYPE_DIR;
! #else
!   dir_link = 0;
  #endif
    links = links_0 = vectorize_string (cwd, SLASH_STRING);
    while (*links)
      {
--- 612,640 ----
    if (cwd_0 == 0)
      error (1, errno, _("can't get working directory"));
    cwd = cwd_0;
!   /* If cwd is an absolute pathname, make `struct file_link' for
!      the root directory on the filesystem where cwd is rooted.  */
!   if (cwd[0] == '/')		/* Unix-like */
!     dir_link = get_link_from_string ("/", 0);
!   else
!     {
! #if DRIVE_LETTER_IN_PATH
!       char root_string[4];	/* "x:/" needs 4 chars */
!       char *root_dir = strpbrk (cwd, SLASH_STRING);
! 
!       if (root_dir)
! 	{
! 	  root_string[0] = '\0';
! 	  strncat (root_string, cwd, root_dir - cwd + 1);
! 	  dir_link = get_link_from_string (root_string, 0);
! 	}
!       else
  #endif
+ 	dir_link = 0;
+     }
+   if (dir_link)
+     dir_link->fl_flags = (dir_link->fl_flags & ~FL_TYPE_MASK) | FL_TYPE_DIR;
+ 
    links = links_0 = vectorize_string (cwd, SLASH_STRING);
    while (*links)
      {
*************** same_as_dot (char const *cwd)
*** 608,614 ****
    struct stat cwd_st;
    struct stat dot_st;
  
!   if (cwd == 0 || *cwd != '/'
        || stat (cwd, &cwd_st) < 0
        || stat (".", &dot_st) < 0)
      return 0;
--- 658,664 ----
    struct stat cwd_st;
    struct stat dot_st;
  
!   if (cwd == 0 || !IS_ABSOLUTE (cwd)
        || stat (cwd, &cwd_st) < 0
        || stat (".", &dot_st) < 0)
      return 0;
*************** chdir_to_link (struct file_link *dir_lin
*** 631,636 ****
--- 681,735 ----
      maybe_relative_file_name (to_dir_name, dir_link, current_dir_link);
    else
      absolute_file_name (to_dir_name, dir_link);
+ 
+ #if DRIVE_LETTER_IN_PATH
+   {
+     /* Must save the original CWD, to be restored at exit.
+        If we are going to change to another drive, must also save the
+        default directory on that drive, so we could restore that too.  */
+     char *cwd = xgetcwd ();
+ 
+     if (orig_drive_idx == -1)
+       {
+ 	/* First time here.  Save the index of original drive
+ 	   and register our cleanup function.  */
+ 	orig_drive_idx = (islower (cwd[0]) ? toupper (cwd[0]) : cwd[0]) - 'A';
+ 	atexit (restore_cwds);
+ 	drive_cwd[orig_drive_idx] = cwd;
+       }
+     if (to_dir_name[1] == ':')
+       {
+ 	int drive_idx = (islower (to_dir_name[0]) ?
+ 			 toupper (to_dir_name[0]) :
+ 			 to_dir_name[0]) - 'A';
+ 	if (drive_cwd[drive_idx] == (char *)0)
+ 	  {
+ 	    /* There's no portable function to get default directory
+ 	       on drive X:, so we chdir to "X:." and call xgetcwd.
+ 	       This assumes that chdir changes the drive as well as
+ 	       the directory (in DJGPP, it does).  */
+ 	    char dot_dir[4];
+ 
+ 	    dot_dir[0] = to_dir_name[0];
+ 	    dot_dir[1] = ':';
+ 	    dot_dir[2] = '.';
+ 	    dot_dir[3] = '\0';
+ 	    if (chdir (dot_dir) < 0)
+ 	      {
+ 		free (cwd);
+ 		error (0, errno, _("can't chdir to `%s'"), dot_dir);
+ 	      }
+ 	    else
+ 	      {
+ 		drive_cwd[drive_idx] = xgetcwd ();
+ 		chdir (cwd);
+ 		free (cwd);
+ 	      }
+ 	  }
+       }
+   }
+ #endif
+ 
    if (chdir (to_dir_name) < 0)
      {
        if (IS_ABSOLUTE (to_dir_name))
*************** chdir_to_link (struct file_link *dir_lin
*** 650,660 ****
--- 749,788 ----
      }
  }
  
+ #if DRIVE_LETTER_IN_PATH
+ 
+ /* Restore current directories on all drives where we changed them;
+    restore the original CWD last.  This is so we eliminate the side
+    effects of changing CWDs on drives other than the default while
+    walking the directory tree there, and also so we always end up in
+    the original CWD, even when `error' is called.  Called at exit.  */
+ static void
+ restore_cwds (void)
+ {
+   int i;
+   for (i = 0; i < MAX_DRIVES; i++)
+     if (i != orig_drive_idx && drive_cwd[i])
+       chdir (drive_cwd[i]);
+   if (orig_drive_idx >= 0 && orig_drive_idx < MAX_DRIVES)
+     chdir (drive_cwd[orig_drive_idx]);
+ }
+ 
+ #endif
+ 
  char **
  vectorize_string (char *string, char *delimiter_class)
  {
    char **vector_0 = MALLOC (char *, 2 + strlen (string) / 2);
    char **vector = vector_0;
+ 
+ #if DRIVE_LETTER_IN_PATH
+   /* Need to get past the drive spec in "d:/", or else the
+      first component of the resulting vector will be wrong.  */
+   if (strcmp (SLASH_STRING, delimiter_class) == 0
+       && IS_ABSOLUTE (string)
+       && strchr (SLASH_STRING, string[2]))
+     string += 2;
+ #endif
    
    *vector = strtok (string, delimiter_class);
    while (*vector)
*************** maybe_relative_file_name (char *buf_0, s
*** 876,882 ****
  	    {
  	      strcpy (buf, (*to_link_vec)->fl_name);
  	      buf += strlen (buf);
! 	      if ((*to_link_vec)->fl_name[0] != SLASH_CHAR && *++to_link_vec)
  		*buf++ = SLASH_CHAR;
  	    }
  	  while (*to_link_vec);
--- 1004,1012 ----
  	    {
  	      strcpy (buf, (*to_link_vec)->fl_name);
  	      buf += strlen (buf);
! 	      if ((buf == buf_0
! 		   || strchr (SLASH_STRING, buf[-1]) == 0)
! 		  && *++to_link_vec)
  		*buf++ = SLASH_CHAR;
  	    }
  	  while (*to_link_vec);
*************** absolute_file_name (char *buf_0, struct 
*** 916,926 ****
      buf_0 = MALLOC (char, PATH_MAX);
    end = absolute_file_name_1 (buf_0, flink);
    /* Clip the trailing slash.  */
! #if HAVE_LINK
!   if (end > &buf_0[1])
      end--;
  #else
!   if (end > &buf_0[3])
      end--;
  #endif
    *end++ = '\0';
--- 1046,1056 ----
      buf_0 = MALLOC (char, PATH_MAX);
    end = absolute_file_name_1 (buf_0, flink);
    /* Clip the trailing slash.  */
! #if DRIVE_LETTER_IN_PATH
!   if (end > &buf_0[3])
      end--;
  #else
!   if (end > &buf_0[1])
      end--;
  #endif
    *end++ = '\0';
*************** absolute_file_name_1 (char *buf, struct 
*** 938,949 ****
    else
      end = absolute_file_name_1 (buf, flink->fl_parent);
    strcpy (end, flink->fl_name);
!   if (*end == SLASH_CHAR)
      end++;
    else
      {
        end += strlen (end);
!       *end++ = SLASH_CHAR;
      }
    return end;
  }
--- 1068,1082 ----
    else
      end = absolute_file_name_1 (buf, flink->fl_parent);
    strcpy (end, flink->fl_name);
!   if (strchr (SLASH_STRING, *end))
      end++;
    else
      {
        end += strlen (end);
!       /* flink->fl_name can have a trailing slash (like in "x:/"),
! 	 in which case we shouldn't add another slash to it.  */
!       if (!strchr (SLASH_STRING, end[-1]))
! 	*end++ = SLASH_CHAR;
      }
    return end;
  }
*************** member_file_qsort_compare (void const *x
*** 994,1000 ****
        result = (links_depth (flx) - links_depth (fly));
        if (result)
  	return result;
!       while (flx->fl_parent != fly->fl_parent)
  	{
  	  flx = flx->fl_parent;
  	  fly = fly->fl_parent;
--- 1127,1139 ----
        result = (links_depth (flx) - links_depth (fly));
        if (result)
  	return result;
!       while (flx->fl_parent != fly->fl_parent
! #if DRIVE_LETTER_IN_PATH
! 	     /* flx and fly may be on different drives, in which case
! 		they don't necessarily share a common parent (the root).  */
! 	     && (flx != flx->fl_parent || fly != fly->fl_parent)
! #endif
! 	     )
  	{
  	  flx = flx->fl_parent;
  	  fly = fly->fl_parent;
*** libidu/idread.c~0	Wed Jul 17 21:55:46 1996
--- libidu/idread.c	Sat Feb 15 17:07:22 1997
*************** struct file_link **
*** 55,61 ****
  maybe_read_id_file (char const *id_file_name, struct idhead *idhp)
  {
    obstack_init (&idhp->idh_file_link_obstack);
!   idhp->idh_FILE = fopen (id_file_name, "r");
    if (idhp->idh_FILE == 0)
      return 0;
  
--- 55,61 ----
  maybe_read_id_file (char const *id_file_name, struct idhead *idhp)
  {
    obstack_init (&idhp->idh_file_link_obstack);
!   idhp->idh_FILE = fopen (id_file_name, "rb");
    if (idhp->idh_FILE == 0)
      return 0;
  
*** libidu/fnprint.c~0	Tue Jul  9 04:19:08 1996
--- libidu/fnprint.c	Sat Feb 15 18:25:30 1997
***************
*** 24,29 ****
--- 24,30 ----
  #include "idfile.h"
  #include "xstring.h"
  #include "xnls.h"
+ #include "xdirent.h"
  #include "pathmax.h"
  #include "error.h"
  
*************** print_filenames (struct file_link **flin
*** 97,103 ****
  		  char *file_name = ALLOCA (char, PATH_MAX);
  		  maybe_relative_file_name (file_name, dlink, cw_dlink);
  		  fputs (file_name, stdout);
! 		  putchar ('/');
  		}
  	      printf ("{%s", root_name (arg->fl_name));
  	    }
--- 98,104 ----
  		  char *file_name = ALLOCA (char, PATH_MAX);
  		  maybe_relative_file_name (file_name, dlink, cw_dlink);
  		  fputs (file_name, stdout);
! 		  putchar (SLASH_CHAR);
  		}
  	      printf ("{%s", root_name (arg->fl_name));
  	    }
*** djgpp/basename.c~0	Fri Jan 24 18:03:10 1997
--- djgpp/basename.c	Sat Jan 25 16:44:28 1997
***************
*** 0 ****
--- 1,45 ----
+ /* basename.c -- return the last element in a path for non-Un*x OSes
+    Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+   
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+   
+    You should have received a copy of the GNU General Public License
+    along with this program; see the file COPYING.  If not, write to the
+    Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+ #endif
+ #include <ansidecl.h>
+ #include "xstring.h"
+ 
+ /* Return NAME with any leading path stripped off.
+    Allow for names with mixed forward and backslashes,
+    and the case with no slashes, like in "d:path".  */
+ 
+ char *
+ DEFUN(basename, (name), CONST char *name)
+ {
+   char *slash, *bslash, *colon;
+ 
+   slash = strrchr (name, '/');
+   bslash = strrchr (name, '\\');
+   colon = (*name && name[1] == ':') ? (char *) name + 1 : 0;
+   if (slash && bslash)
+     if (bslash > slash)
+       slash = bslash;
+   if (!slash)
+     slash = bslash;
+   if (!slash)
+     slash = colon;
+   return slash ? slash + 1 : (char *) name;
+ }
*** djgpp/dirname.c~0	Fri Jan 24 18:03:10 1997
--- djgpp/dirname.c	Sat Jan 25 14:18:16 1997
***************
*** 0 ****
--- 1,40 ----
+ /* dirname.c -- return the leading elements in a path for non-Un*x OSes
+    Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ 
+ The Linux C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+ 
+ The Linux C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Library General Public License for more details.
+ 
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB.  If
+ not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+ Cambridge, MA 02139, USA.  */
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+ #endif
+ #include <ansidecl.h>
+ #include "xstring.h"
+ 
+ /* Return NAME with any leading path stripped off.  */
+ 
+ extern char * EXFUN(basename, (CONST char *));
+ 
+ char *
+ DEFUN(dirname, (name), CONST char *name)
+ {
+   char *base = basename (name);
+ 
+   while (base > name && base[-1] == '/' || base[-1] == '\\')
+     base--;
+   if (*base == '/' && (base == name || base[-1] == ':'))
+     base++;
+ 
+   return base > name ? strndup (name, base - name) : ".";
+ }
*** src/fid.c~0	Wed Aug  7 03:22:14 1996
--- src/fid.c	Sat Jan 25 14:53:42 1997
***************
*** 19,24 ****
--- 19,25 ----
  #include <config.h>
  #include <stdio.h>
  #include <getopt.h>
+ #include "xdirent.h"
  #include "xstring.h"
  #include "xunistd.h"
  #include "xnls.h"
*************** get_file_index (char *file_name)
*** 204,214 ****
    struct file_link **end = &members_0[idh.idh_files];
    struct file_link *fn_flink = 0;
    char *file_name_buf = ALLOCA (char, PATH_MAX);
!   int has_slash = (strchr (file_name, '/') != 0);
    int file_name_length = strlen (file_name);
    int idx = -1;
  
    if (strstr (file_name, "./"))
      fn_flink = parse_file_name (file_name, cw_dlink);
  
    for (members = members_0; members < end; members++)
--- 205,221 ----
    struct file_link **end = &members_0[idh.idh_files];
    struct file_link *fn_flink = 0;
    char *file_name_buf = ALLOCA (char, PATH_MAX);
!   int has_slash = (strpbrk (file_name, SLASH_STRING) != 0);
    int file_name_length = strlen (file_name);
    int idx = -1;
  
+ /* On non-Un*x filesystems there are too many cases where we have
+    semi-absolute pathnames (like "d:path", "d:\\dir\\..\\path" etc.)
+    where simple filename comparison won't work.  It is safer to
+    call `parse_file_name' for all filenames on those systems.  */
+ #if !DRIVE_LETTER_IN_PATH
    if (strstr (file_name, "./"))
+ #endif
      fn_flink = parse_file_name (file_name, cw_dlink);
  
    for (members = members_0; members < end; members++)
*** src/fnid.c~0	Tue Jul  9 04:19:08 1996
--- src/fnid.c	Sat Jan 25 15:03:02 1997
***************
*** 19,24 ****
--- 19,25 ----
  #include <config.h>
  #include <stdio.h>
  #include <getopt.h>
+ #include "xdirent.h"
  #include "xfnmatch.h"
  #include "xstring.h"
  #include "xmalloc.h"
*************** main (int argc, char **argv)
*** 163,169 ****
        {
  	char *arg = *argv;
  	*patv++ = arg;
! 	if (*arg != '*' && *arg != '/')
  	  {
  	    char *pat = MALLOC (char, strlen (arg) + 2);
  	    sprintf (pat, "*/%s", arg);
--- 164,176 ----
        {
  	char *arg = *argv;
  	*patv++ = arg;
! 	if (*arg != '*' && *arg != '/'
! #if DRIVE_LETTER_IN_PATH
! 	    /* slash as the first character is not the only case
! 	       of an absolute filename... */
! 	    && !IS_ABSOLUTE (arg)
! #endif
! 	    )
  	  {
  	    char *pat = MALLOC (char, strlen (arg) + 2);
  	    sprintf (pat, "*/%s", arg);
*** src/lid.c~0	Wed Aug  7 02:43:28 1996
--- src/lid.c	Wed Jan 29 15:26:34 1997
***************
*** 44,49 ****
--- 44,54 ----
  # include <rx.h>
  #endif
  
+ #ifdef __DJGPP__
+ #include <conio.h>
+ #define getchar getch
+ #endif
+ 
  typedef void (*report_func_t) __P((char const *name, struct file_link **flinkv));
  typedef int (*query_func_t) __P((char const *arg, report_func_t));
  
*************** editit:
*** 700,709 ****
--- 705,716 ----
    switch (fork ())
      {
      case -1:
+ #ifndef MSDOS
        error (1, errno, _("can't fork"));
        break;
  
      case 0:
+ #endif
        {
  	char **argv_0 = MALLOC (char *, 3 + vector_cardinality (flinkv));
  	char **argv = argv_0 + 2;
*************** editit:
*** 717,726 ****
--- 724,760 ----
  	    *argv-- = ed_arg_buffer;
  	  }
  	*(char const **) argv = editor;
+ #ifdef MSDOS
+ 	{
+ 	  void (*oldint) __P((int)) = signal (SIGINT, SIG_IGN);
+ 	  void (*oldquit) __P((int)) = signal (SIGQUIT, SIG_IGN);
+ 	  /* People say ``set EDITOR=myedit -options'', so we can't
+ 	     call `spawnXX'.  But `system' will work.  */
+ 	  char *cmdline, **av = argv;
+ 	  int   cmdlen;
+ 
+ 	  /* How long need the command line be?  */
+ 	  for (cmdlen = 0; *av; av++)
+ 	    cmdlen += strlen (*av) + 1;
+ 
+ 	  /* Build the command line.  */
+ 	  cmdline = ALLOCA (char, cmdlen + 1);
+ 	  cmdline[0] = '\0';
+ 	  for (av = argv; *av; av++)
+ 	    strcat (strcat (cmdline, " "), *av);
+ 
+ 	  if (system (cmdline))
+ 	    error (0, errno, _("can't exec `%s'"), editor);
+ 	  signal (SIGINT, oldint);
+ 	  signal (SIGQUIT, oldquit);
+ 	}
+ #else
  	execvp (editor, argv);
  	error (0, errno, _("can't exec `%s'"), editor);
+ #endif
        }
  
+ #ifndef MSDOS
      default:
        {
  	void (*oldint) __P((int)) = signal (SIGINT, SIG_IGN);
*************** editit:
*** 733,738 ****
--- 767,773 ----
  	signal (SIGQUIT, oldquit);
        }
        break;
+ #endif
      }
  }
  
*** src/aid.b~0	Fri Jan 24 18:03:10 1997
--- src/aid.bat	Sat Jan 25 18:25:34 1997
***************
*** 0 ****
--- 1,2 ----
+ @echo off
+ lid -ils %1 %2 %3 %4 %5 %6 %7 %8 %9
*** src/defid.b~0	Fri Jan 24 18:03:10 1997
--- src/defid.bat	Sat Jan 25 18:43:36 1997
***************
*** 0 ****
--- 1,7 ----
+ @echo off
+ :again
+ if "%1" == "" goto end
+ call gid %1 | egrep "(}[ 	]*|:[ 	]*#[ 	]*define[ 	]+)%1|typedef\>.*[ 	]+%1"
+ shift
+ goto again
+ :end
*** src/eid.b~0	Fri Jan 24 18:03:10 1997
--- src/eid.bat	Sat Jan 25 18:36:34 1997
***************
*** 0 ****
--- 1,2 ----
+ @echo off
+ lid -R edit %1 %2 %3 %4 %5 %6 %7 %8 %9
*** src/gid.b~0	Fri Jan 24 18:03:10 1997
--- src/gid.bat	Sat Jan 25 18:37:18 1997
***************
*** 0 ****
--- 1,2 ----
+ @echo off
+ lid -R grep %1 %2 %3 %4 %5 %6 %7 %8 %9
*** testsuite/consistency.orig	Mon Jul  8 02:05:56 1996
--- testsuite/consistency	Wed Jan 29 10:21:00 1997
***************
*** 26,34 ****
  	rm -f ID.xti ID.lid
  	echo "Good.  xtokid and lid agree."
      else
! 	mv ID.xti ID.bad-xti
! 	mv ID.fid ID.bad-fid
! 	1>&2 echo "Oops!  xtokid and lid disagree--look in ID.bad-{xtokid,lid}"
  	errors=t
      fi
  
--- 26,34 ----
  	rm -f ID.xti ID.lid
  	echo "Good.  xtokid and lid agree."
      else
! 	mv ID.xti ID-xti.bad
! 	mv ID.lid ID-lid.bad
! 	1>&2 echo "Oops!  xtokid and lid disagree--look in ID-{xti,lid}.bad"
  	errors=t
      fi
  
***************
*** 43,51 ****
  	then
  	    echo "Good.  xtokid and fid agree for $file"
  	else
! 	    1>&2 echo "Oops!  xtokid and fid disagree for $file--look in $file.bad-{xtokid,fid}"
! 	    mv $xtokid_file $file.bad-xti
! 	    mv $fid_file $file.bad-fid
  	    errors=t
  	fi
      done
--- 43,51 ----
  	then
  	    echo "Good.  xtokid and fid agree for $file"
  	else
! 	    1>&2 echo "Oops!  xtokid and fid disagree for $file--look in {xti,fid}-${file}-bad"
! 	    mv $xtokid_file xti-${file}-bad
! 	    mv $fid_file fid-${file}-bad
  	    errors=t
  	fi
      done
*** doc/id-utils.t~0	Thu Jul  4 19:32:42 1996
--- doc/id-utils.texi	Wed Jan 29 16:12:44 1997
***************
*** 255,261 ****
  colon-separated list of ID database names.  If this variable is present,
  and no @samp{--file} options are presented on the command line, the ID
  databases named in @samp{IDPATH} are implied.@footnote{At present, this
! feature is fully implemented, since only the first of a list of ID
  database names is processed.}
  
  @end table
--- 255,261 ----
  colon-separated list of ID database names.  If this variable is present,
  and no @samp{--file} options are presented on the command line, the ID
  databases named in @samp{IDPATH} are implied.@footnote{At present, this
! feature isn't fully implemented, since only the first of a list of ID
  database names is processed.}
  
  @end table
***************
*** 554,560 ****
  @opindex --lang-option=C:-i
  @opindex --lang-option=C:--ignore
  
!      x mkiConsider the characters in @var{character-class} as valid constituents of
  identifier names, but discard all tokens containing these characters.
  For example, if some C code has identifiers containing @samp{$}, but you
  don't want these cluttering up your ID database, use
--- 554,560 ----
  @opindex --lang-option=C:-i
  @opindex --lang-option=C:--ignore
  
! Consider the characters in @var{character-class} as valid constituents of
  identifier names, but discard all tokens containing these characters.
  For example, if some C code has identifiers containing @samp{$}, but you
  don't want these cluttering up your ID database, use
***************
*** 630,637 ****
  @opindex --lang-option=asm:-i
  @opindex --lang-option=asm:--ignore
  
! Consider the characters of @var{character-class} as valid consituents of
! identifier names, but discard all tokens containing these characters.
  For example, if you don't want to clutter your ID database with
  assembler directives that begin with a leading @samp{.} or with
  assembler labels that contain @samp{@@}, use
--- 630,637 ----
  @opindex --lang-option=asm:-i
  @opindex --lang-option=asm:--ignore
  
! Consider the characters of @var{character-class} as valid constituents
! of identifier names, but discard all tokens containing these characters.
  For example, if you don't want to clutter your ID database with
  assembler directives that begin with a leading @samp{.} or with
  assembler labels that contain @samp{@@}, use
***************
*** 721,727 ****
  language @var{foo}, you must define the functions @code{get_token_foo},
  @code{parse_args_foo}, @code{help_me_foo}, as well as the tables
  @code{long_options_foo} and @code{args_foo}.  If your scanner is
! modelled after one of the existing scanners, you'll also need a
  character-attribute table @code{ctype_foo}.
  
  This is not a terribly difficult programming task, but it requires
--- 721,727 ----
  language @var{foo}, you must define the functions @code{get_token_foo},
  @code{parse_args_foo}, @code{help_me_foo}, as well as the tables
  @code{long_options_foo} and @code{args_foo}.  If your scanner is
! modeled after one of the existing scanners, you'll also need a
  character-attribute table @code{ctype_foo}.
  
  This is not a terribly difficult programming task, but it requires
***************
*** 729,736 ****
  You should use @file{xtokid} to test the operation of the new scanner.
  
  Once these functions and tables are ready, add function prototypes and
! an entry to to the @code{languages_0} table near the beginning of the
! file.
  
  Be warned that the existing scanners are built for speed, not elegance
  or readability.  You might wish to create a new scanner that's easier to
--- 729,735 ----
  You should use @file{xtokid} to test the operation of the new scanner.
  
  Once these functions and tables are ready, add function prototypes and
! an entry to the @code{languages_0} table near the beginning of the file.
  
  Be warned that the existing scanners are built for speed, not elegance
  or readability.  You might wish to create a new scanner that's easier to
***************
*** 758,765 ****
  operating with a working-set size that is only half the size of its
  virtual address space.  A typical @sc{UNIX}-like operating system with
  16 megabytes of system memory should be able to build an ID database
! covering approximately 12,000-14,000 source files totalling
! approximately 50--100 Megabytes.  A 66 Mhz 486 computer can build such
  a large ID database in approximately 10-15 minutes.
  
  @pindex cron
--- 757,764 ----
  operating with a working-set size that is only half the size of its
  virtual address space.  A typical @sc{UNIX}-like operating system with
  16 megabytes of system memory should be able to build an ID database
! covering approximately 12,000-14,000 source files totaling
! approximately 50--100 Megabytes.  A 66 MHz 486 computer can build such
  a large ID database in approximately 10-15 minutes.
  
  @pindex cron
***************
*** 863,870 ****
  @opindex -w
  @opindex --word
  
! Match @var{pattern} using a word-delimited (non substring) search.  This is the default
! for literal searches.
  
  @item -s
  @itemx --substring
--- 862,869 ----
  @opindex -w
  @opindex --word
  
! Match @var{pattern} using a word-delimited (non substring) search.  This
! is the default for literal searches.
  
  @item -s
  @itemx --substring
***************
*** 1134,1140 ****
  common to both files (i.e., the @emph{set intersection} of the two token
  sets).
  
! @file{lid} reads the ID database, therefore it accepts the @samp{--file}
  option, and consults the @samp{IDPATH} environment variable, as
  described in @ref{Reading options}.
  
--- 1133,1139 ----
  common to both files (i.e., the @emph{set intersection} of the two token
  sets).
  
! @file{fid} reads the ID database, therefore it accepts the @samp{--file}
  option, and consults the @samp{IDPATH} environment variable, as
  described in @ref{Reading options}.
  
***************
*** 1149,1160 ****
  @cindex filenames, matching
  @cindex matching filenames
  
! @code{fnid} queries the list of file names stored in the ID database.
  It accepts shell @emph{wildcard} patterns on the command line.  If no
  pattern is supplied, @file{*} is implied.  @file{fnid} prints the
  file names that match the given patterns.
  
! @code{fnid} prints file names, and as such accepts the
  @samp{--separator} option as described in @ref{File listing options}.
  
  For example, the command:
--- 1148,1159 ----
  @cindex filenames, matching
  @cindex matching filenames
  
! @file{fnid} queries the list of file names stored in the ID database.
  It accepts shell @emph{wildcard} patterns on the command line.  If no
  pattern is supplied, @file{*} is implied.  @file{fnid} prints the
  file names that match the given patterns.
  
! @file{fnid} prints file names, and as such accepts the
  @samp{--separator} option as described in @ref{File listing options}.
  
  For example, the command:
***************
*** 1221,1227 ****
  posted to @file{alt.sources} near the end of 1990.  At that time, Tom
  wrote a Texinfo manual with the encouragement the net community.
  (Tom especially thanks Doug Scofield and Bill Leonard whom he dragooned
! into helping poorfraed and edit---they found several problems in the
  initial version.)  Karl Berry revamped the manual for Texinfo style,
  indexing, and organization in 1995.
  
--- 1220,1226 ----
  posted to @file{alt.sources} near the end of 1990.  At that time, Tom
  wrote a Texinfo manual with the encouragement the net community.
  (Tom especially thanks Doug Scofield and Bill Leonard whom he dragooned
! into helping proofread and edit---they found several problems in the
  initial version.)  Karl Berry revamped the manual for Texinfo style,
  indexing, and organization in 1995.
  
*** libidu/id-lang.m~0	Wed May 29 19:19:40 1996
--- libidu/id-lang.map	Wed Jan 29 16:04:16 1997
***************
*** 65,70 ****
--- 65,72 ----
  
  *.tex			TeX
  *.ltx			TeX
+ *.txi			texinfo
+ *.txh			texinfo
  *.texi			texinfo
  *.texinfo		texinfo
  
***************
*** 86,88 ****
--- 88,92 ----
  
  *.gz			FILTER gzip -d <%s
  *.Z			FILTER gzip -d <%s
+ *.tgz			FILTER gzip -d <%s
+ *.taz			FILTER gzip -d <%s
*** djgpp/config.b~0	Wed Aug  7 03:16:34 1996
--- djgpp/config.bat	Sat Feb 22 18:05:52 1997
***************
*** 0 ****
--- 1,56 ----
+ @echo off
+ set XSRC=.
+ if not "%1" == "" set XSRC=%1
+ test -d %XSRC%
+ if not errorlevel 1 goto chkdir
+ echo %XSRC% is not a directory
+ goto end
+ :chkdir
+ test -f %XSRC%/configure
+ if not errorlevel 1 goto argsok
+ echo I cannot find the configure script in the directory %XSRC%
+ goto end
+ :argsok
+ rem set SYSROOT=c:
+ set PATH_SEPARATOR=:
+ set PATH_EXPAND=y
+ if not "%HOSTNAME%" == "" goto hostdone
+ if "%windir%" == "" goto msdos
+ set OS=MS-Windows
+ goto haveos
+ :msdos
+ set OS=MS-DOS
+ :haveos
+ if not "%USERNAME%" == "" goto haveuname
+ if not "%USER%" == "" goto haveuser
+ echo No USERNAME and no USER found in the environment, using default values
+ set HOSTNAME=Unknown PC
+ :haveuser
+ set HOSTNAME=%USER%'s PC
+ goto userdone
+ :haveuname
+ set HOSTNAME=%USERNAME%'s PC
+ :userdone
+ set HOSTNAME=%HOSTNAME%, %OS%
+ :hostdone
+ set OS=
+ set CONFIG_SHELL=bash.exe
+ if not exist configure.orig cp -p %XSRC%/configure configure.orig
+ update %XSRC%/djgpp/configure configure
+ if not exist lib\NUL mkdir lib
+ if not exist lib\basename.orig cp -p %XSRC%/lib/basename.c lib/basename.orig
+ if not exist lib\dirname.orig cp -p %XSRC%/lib/dirname.c lib/dirname.orig
+ update %XSRC%/djgpp/basename.c lib/basename.c
+ update %XSRC%/djgpp/dirname.c lib/dirname.c
+ set CFLAGS=-O2 -g
+ set INSTALL=${DJDIR}/bin/ginstall
+ sh %XSRC%/configure --prefix='${DJDIR}' --disable-nls
+ set XSRC=
+ set CFLAGS=
+ set CONFIG_SHELL=
+ echo updating Makefiles for DJGPP...
+ mv -f Makefile Makefile.tmp
+ sed -e 's/\.h\.in/.h-in/g' Makefile.tmp > Makefile
+ touch Makefile -r Makefile.tmp
+ rm -f Makefile.tmp
+ :end
*** configure.orig	Wed Aug  7 03:16:34 1996
--- djgpp/configure	Sat Feb 22 18:03:06 1997
***************
*** 614,620 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_prog_CC="gcc"
        break
      fi
--- 614,620 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_prog_CC="gcc"
        break
      fi
***************
*** 643,649 ****
    ac_prog_rejected=no
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
          ac_prog_rejected=yes
  	continue
--- 643,649 ----
    ac_prog_rejected=no
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
          ac_prog_rejected=yes
  	continue
***************
*** 747,757 ****
  
  ac_aux_dir=
  for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
!   if test -f $ac_dir/install-sh; then
      ac_aux_dir=$ac_dir
      ac_install_sh="$ac_aux_dir/install-sh -c"
      break
!   elif test -f $ac_dir/install.sh; then
      ac_aux_dir=$ac_dir
      ac_install_sh="$ac_aux_dir/install.sh -c"
      break
--- 747,757 ----
  
  ac_aux_dir=
  for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
!   if test -x $ac_dir/install-sh; then
      ac_aux_dir=$ac_dir
      ac_install_sh="$ac_aux_dir/install-sh -c"
      break
!   elif test -x $ac_dir/install.sh; then
      ac_aux_dir=$ac_dir
      ac_install_sh="$ac_aux_dir/install.sh -c"
      break
***************
*** 787,793 ****
      *)
        # OSF1 and SCO ODT 3.0 have their own names for install.
        for ac_prog in ginstall installbsd scoinst install; do
!         if test -f $ac_dir/$ac_prog; then
  	  if test $ac_prog = install &&
              grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
  	    # AIX install.  It has an incompatible calling convention.
--- 787,793 ----
      *)
        # OSF1 and SCO ODT 3.0 have their own names for install.
        for ac_prog in ginstall installbsd scoinst install; do
!         if test -x $ac_dir/$ac_prog; then
  	  if test $ac_prog = install &&
              grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
  	    # AIX install.  It has an incompatible calling convention.
***************
*** 966,972 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_prog_RANLIB="ranlib"
        break
      fi
--- 966,972 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_prog_RANLIB="ranlib"
        break
      fi
***************
*** 3121,3127 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
  	ac_cv_path_MSGFMT="$ac_dir/$ac_word"
  	break
--- 3121,3127 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
  	ac_cv_path_MSGFMT="$ac_dir/$ac_word"
  	break
***************
*** 3207,3213 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
        break
      fi
--- 3207,3213 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
        break
      fi
***************
*** 3238,3244 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
  	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
  	break
--- 3238,3244 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
  	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
  	break
***************
*** 3402,3408 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_path_GENCAT="$ac_dir/$ac_word"
        break
      fi
--- 3402,3408 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_path_GENCAT="$ac_dir/$ac_word"
        break
      fi
***************
*** 3433,3439 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
        break
      fi
--- 3433,3439 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
        break
      fi
***************
*** 3465,3471 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
  	ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
  	break
--- 3465,3471 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
  	ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
  	break
***************
*** 3499,3505 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
  	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
  	break
--- 3499,3505 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
  	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
  	break
***************
*** 3556,3562 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
  	ac_cv_path_MSGFMT="$ac_dir/$ac_word"
  	break
--- 3556,3562 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
  	ac_cv_path_MSGFMT="$ac_dir/$ac_word"
  	break
***************
*** 3589,3595 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
        break
      fi
--- 3589,3595 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
        break
      fi
***************
*** 3620,3626 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
  	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
  	break
--- 3620,3626 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
  	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
  	break
***************
*** 3750,3756 ****
                 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
     fi
        sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
!      $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
  
              if test "$PACKAGE" = "gettext"; then
       GT_NO="#NO#"
--- 3750,3756 ----
                 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
     fi
        sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
!      $srcdir/intl/po2tblin.sed > intl/po2tbl.sed
  
              if test "$PACKAGE" = "gettext"; then
       GT_NO="#NO#"
***************
*** 3820,3826 ****
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -f $ac_dir/$ac_word; then
        ac_cv_path_EMACS="$ac_dir/$ac_word"
        break
      fi
--- 3820,3826 ----
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    for ac_dir in $PATH; do
      test -z "$ac_dir" && ac_dir=.
!     if test -x $ac_dir/$ac_word; then
        ac_cv_path_EMACS="$ac_dir/$ac_word"
        break
      fi
***************
*** 3952,3958 ****
  done
  
  ac_given_srcdir=$srcdir
! ac_given_INSTALL="$INSTALL"
  
  trap 'rm -fr `echo "Makefile doc/Makefile lib/Makefile libidu/Makefile src/Makefile lisp/Makefile intl/Makefile po/Makefile.in testsuite/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
  EOF
--- 3952,3958 ----
  done
  
  ac_given_srcdir=$srcdir
! ac_given_INSTALL='$INSTALL'
  
  trap 'rm -fr `echo "Makefile doc/Makefile lib/Makefile libidu/Makefile src/Makefile lisp/Makefile intl/Makefile po/Makefile.in testsuite/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
  EOF
***************
*** 4036,4041 ****
--- 4036,4042 ----
  for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
    # Support "outfile[:infile]", defaulting infile="outfile.in".
    case "$ac_file" in
+   *.in) ac_file_in=${ac_file}-in ;;
    *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
         ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
    *) ac_file_in="${ac_file}.in" ;;
***************
*** 4109,4114 ****
--- 4110,4116 ----
  for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
    # Support "outfile[:infile]", defaulting infile="outfile.in".
    case "$ac_file" in
+   *.h) ac_file_in=${ac_file}-in ;;
    *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
         ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
    *) ac_file_in="${ac_file}.in" ;;
