[comp.emacs] Patch for 18.40

rms@PREP.AI.MIT.EDU (Richard M. Stallman) (03/19/87)

I'm told that the function getwd, in sysdep.c, needs to be changed
as follows for some machines.  (This definition of getwd is used
on USG systems.)  Can you please install this in your copies of 18.40
and verify that it does not break Emacs on your system?

char *
getwd (pathname)
     char *pathname;
{
  char *npath;
  extern char *getcwd ();

  npath = getcwd (0, MAXPATHLEN);
  /* On Altos 3068, getcwd can return @hostname/dir, so discard
     up to first slash.  Should be harmless on other systems.  */
  while (*npath && *npath != '/')
    npath++;
  strcpy (pathname, npath);
  return pathname;
}