From xemacs-m  Mon Jan 13 16:21:41 1997
Received: from venus.Sun.COM (venus.Sun.COM [192.9.25.5])
          by xemacs.org (8.8.4/8.8.4) with SMTP
	  id QAA07831 for <xemacs-beta@xemacs.org>; Mon, 13 Jan 1997 16:21:40 -0600 (CST)
Received: from Eng.Sun.COM ([129.146.1.25]) by venus.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id OAA16946; Mon, 13 Jan 1997 14:21:11 -0800
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id OAA04376; Mon, 13 Jan 1997 14:21:07 -0800
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id OAA26948; Mon, 13 Jan 1997 14:21:05 -0800
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id OAA20487; Mon, 13 Jan 1997 14:21:05 -0800
Date: Mon, 13 Jan 1997 14:21:05 -0800
Message-Id: <199701132221.OAA20487@xemacs.eng.sun.com>
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: Soren Dayton <csdayton@cs.uchicago.edu>
Cc: xemacs-beta@xemacs.org
Subject: mostly successful build report
In-Reply-To: <xcdiv52y9qh.fsf@gargoyle164.cs.uchicago.edu>
References: <xcdiv52y9qh.fsf@gargoyle164.cs.uchicago.edu>
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>
Mime-Version: 1.0 (generated by tm-edit 7.100)
Content-Type: text/plain; charset=US-ASCII

>>>>> "Soren" == Soren Dayton <csdayton@cs.uchicago.edu> writes:

Soren> which looks correct, but when I tried it with `--const-is-losing=no'
Soren> there were some errors in sys_execvp in sysdep.c about assigning to
Soren> non-lvalues. there was a `(path) = .......' in the macro but I do not
Soren> fully understand what is going on there.  In any case, it went away with
Soren> turning off const.

The following patch allows a build on Solaris with
--const-is-losing=no.

Mon Jan 13 00:36:01 1997  Martin Buchholz  <mrb@eng.sun.com>

	* sysdep.c (sys_execvp): Fix when compiled with
	--const-is-losing=no.  Old code could crash if argv contained
	non-ascii characters and the execvp failed and then caller
	examined argv (for error message, for example).

*** /tmp/geta2870	Mon Jan 13 14:13:57 1997
--- sysdep.c	Mon Jan 13 13:46:37 1997
***************
*** 3237,3249 ****
  
  #ifdef ENCAPSULATE_EXECVP
  int
! sys_execvp (CONST char *path, char * CONST argv[])
  {
!   int i;
    PATHNAME_CONVERT_OUT (path);
!   for (i = 0; argv[i]; i++)
!     PATHNAME_CONVERT_OUT (argv[i]);
!   return execvp (path, argv);
  }
  #endif /* ENCAPSULATE_EXECVP */
  
--- 3237,3255 ----
  
  #ifdef ENCAPSULATE_EXECVP
  int
! sys_execvp (CONST char *path, char * CONST * argv)
  {
!   int i, argc;
!   CONST char ** new_argv;
!   
    PATHNAME_CONVERT_OUT (path);
!   for (argc = 0; argv[argc]; argc++)
!     ;
!   new_argv = (CONST char **) alloca ( (argc + 1) * sizeof (* new_argv));
!   for (i = 0; i < argc; i++)
!     GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (argv[i], new_argv[i]);
!   new_argv[argc] = NULL;
!   return execvp (path, (char **) new_argv);
  }
  #endif /* ENCAPSULATE_EXECVP */
  

Martin

