[comp.emacs] Emacs client server bug fix - SYSV - 18.50

craig@ncrcpx.UUCP (R. Craig Peterson) (03/09/88)

There is a bug in the emacsclient.c program for those who want to use
it under system V.  Its one of those nasty uninitialized dereff'ed
pointer tricks.  (BTW, why do some systems have virtual address zero
as a valid address?  Yech!  It should have core dumped.)  I don't have
the original code, so here's the fragment from the emacsclient.c.
It's the main routine that builds the file names for editing.  Maybe
some kind soul could post the diffs?

  while (argc)
    {
      if (*argv[0] != '/')
	{
	  cwd = gwdirb; *cwd = '\0';
	  if (getcwd (gwdirb, sizeof gwdirb))
	    {
	      strcat (cwd, "/");
	    }
	  else
	    {
	      fprintf (stderr, cwd);
	      *cwd = '\0';
	    }
	  strcat (msgp->mtext, cwd);	/* Here's the fix - Craig, N8INO */
	}
      strcat (msgp->mtext, argv[0]);
      strcat (msgp->mtext, " ");
      argv++; argc--;
  }  

The problem only occured if a full pathname was given for a file.
Actually this happens quite a bit, so it wasn't very nice.
-- 
R. Craig Peterson
ncrlnk!ncrcam!ncrcpx!craig	craig@ncrcpx.Cambridge.NCR.COM
N8INO
E Pluribus Unum 	(NSA stuff - terrorist, DES, cipher, secret, NRO, CIA)