* environ.c (set_in_environ): Eliminate special handling of PATH and
authorJim Kingdon <jkingdon@engr.sgi.com>
Tue, 15 Mar 1994 18:40:51 +0000 (18:40 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Tue, 15 Mar 1994 18:40:51 +0000 (18:40 +0000)
GNUTARGET.
* putenv.c: Removed, conflicts with system declaration of
putenv on RS/6000 running AIX 3.2.5, and above change makes it
unnecessary.
* Makefile.in: Change accordingly.
* procfs.c (procfs_create_inferior): Change comment accordingly.

gdb/.Sanitize
gdb/ChangeLog
gdb/Makefile.in
gdb/procfs.c
gdb/putenv.c [deleted file]

index 58c3671852a97f10990b392e2817c01a670a5e90..242b209621f8c9026f5b21e3b49ea0d85bae6168 100644 (file)
@@ -194,7 +194,6 @@ parser-defs.h
 partial-stab.h
 printcmd.c
 procfs.c
-putenv.c
 pyr-pinsn.c
 pyr-tdep.c
 pyr-xdep.c
index 21d0292e26dcd63501c3524de65e048211494255..3eea40123c79102dfe72558038d2dce212227525 100644 (file)
@@ -1,3 +1,13 @@
+Tue Mar 15 10:33:28 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
+
+       * environ.c (set_in_environ): Eliminate special handling of PATH and
+       GNUTARGET.
+       * putenv.c: Removed, conflicts with system declaration of
+       putenv on RS/6000 running AIX 3.2.5, and above change makes it
+       unnecessary. 
+       * Makefile.in: Change accordingly.
+       * procfs.c (procfs_create_inferior): Change comment accordingly.
+
 Tue Mar 15 10:05:27 1994  Jim Kingdon  (kingdon@cygnus.com)
 
        * rs6000-tdep.c: Change value to value_ptr.
index 87e4fcf9fb498ecf1eab49fa559e2505833079e6..b5effb9996ad4609953093839802f4ef95bfcc0d 100644 (file)
@@ -300,7 +300,7 @@ SFILES = blockframe.c breakpoint.c buildsym.c c-exp.y c-lang.c \
        c-typeprint.c c-valprint.c ch-exp.y ch-lang.c ch-typeprint.c \
        ch-valprint.c coffread.c command.c complaints.c core.c cp-valprint.c \
        dbxread.c demangle.c dwarfread.c elfread.c environ.c eval.c expprint.c \
-       findvar.c gdbtypes.c infcmd.c inflow.c infrun.c language.c putenv.c \
+       findvar.c gdbtypes.c infcmd.c inflow.c infrun.c language.c \
        m2-exp.y m2-lang.c m2-typeprint.c m2-valprint.c main.c maint.c \
        mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c parse.c \
        printcmd.c remote.c source.c stabsread.c stack.c symfile.c symmisc.c \
@@ -440,7 +440,7 @@ OBS =       version.o main.o blockframe.o breakpoint.o findvar.o stack.o thread.o \
        source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \
        symtab.o symfile.o symmisc.o infcmd.o infrun.o command.o \
        utils.o expprint.o environ.o gdbtypes.o copying.o $(DEPFILES) \
-       mem-break.o target.o putenv.o parse.o language.o $(YYOBJ) buildsym.o \
+       mem-break.o target.o parse.o language.o $(YYOBJ) buildsym.o \
        objfiles.o minsyms.o maint.o demangle.o dbxread.o coffread.o elfread.o \
        dwarfread.o mipsread.o stabsread.o core.o c-lang.o ch-lang.o m2-lang.o \
        complaints.o typeprint.o c-typeprint.o ch-typeprint.o m2-typeprint.o \
@@ -1337,8 +1337,6 @@ printcmd.o: printcmd.c $(breakpoint_h) $(defs_h) $(expression_h) \
 procfs.o: procfs.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
        target.h
 
-putenv.o: putenv.c
-
 pyr-pinsn.o: pyr-pinsn.c $(OP_INCLUDE)/pyr.h $(defs_h) $(gdbcore_h) \
        $(symtab_h)
 
index 86d7bb7706fe7949e15ca7399e41ee10557094ea..be948037a7af1b198af52e4835d25726cd4fce74 100644 (file)
@@ -3452,8 +3452,8 @@ procfs_create_inferior (exec_file, allargs, env)
 
       char *p;
       char *p1;
-      /* FIXME-maybe: might want "set path" command to replace putenv hack
-        in set_in_environ.  */
+      /* FIXME-maybe: might want "set path" command so user can change what
+        path is used from within GDB.  */
       char *path = getenv ("PATH");
       int len;
       struct stat statbuf;
diff --git a/gdb/putenv.c b/gdb/putenv.c
deleted file mode 100644 (file)
index b15516d..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************/
-/*                                                             */
-/*     putenv(3)                                               */
-/*                                                             */
-/*             Change or add an environment entry              */
-/*                                                             */
-/****************************************************************/
-/*   origination        1987-Oct-7               T. Holm       */
-/****************************************************************/
-
-/*
-Path: hoptoad!pacbell!ames!ll-xn!mit-eddie!uw-beaver!ssc-vax!uvicctr!tholm
-From: tholm@uvicctr.UUCP (Terrence W. Holm)
-Newsgroups: comp.os.minix
-Subject: putenv(3)
-Message-ID: <395@uvicctr.UUCP>
-Date: 5 May 88 06:40:52 GMT
-Organization: University of Victoria, Victoria B.C. Canada
-
-EFTH Minix report #2  - May 1988 -  putenv(3)
-
-This is an implementation of putenv(3) that we
-wrote for Minix. Please consider this a public
-domain program.
-*/
-
-#include <stdio.h>
-#include <string.h>
-
-#define  PSIZE  sizeof(char *)
-
-extern  char  **environ;
-
-char  *strchr();
-char  *malloc();
-
-/****************************************************************/
-/*                                                             */
-/*      int                                                    */
-/*     putenv( entry )                                         */
-/*                                                             */
-/*             The "entry" should follow the form              */
-/*             "NAME=VALUE". This routine will search the      */
-/*             user environment for "NAME" and replace its     */
-/*             value with "VALUE".                             */
-/*                                                             */
-/*             Note that "entry" is not copied, it is used     */
-/*             as the environment entry. This means that it    */
-/*             must not be unallocated or otherwise modifed    */
-/*             by the caller, unless it is replaced by a       */
-/*             subsequent putenv().                            */
-/*                                                             */
-/*             If the name is not found in the environment,    */
-/*             then a new vector of pointers is allocated,     */
-/*             "entry" is put at the end and the global        */
-/*             variable "environ" is updated.                  */
-/*                                                             */
-/*             This function normally returns NULL, but -1     */
-/*             is returned if it can not allocate enough       */
-/*             space using malloc(3), or "entry" does not      */
-/*             contain a '='.                                  */
-/*                                                             */
-/****************************************************************/
-
-
-int
-putenv( entry )
-  char *entry;
-{
-  unsigned length;
-  unsigned size;
-  char     *temp;
-  char     **p;
-  char     **new_environ;
-
-  /*  Find the length of the "NAME="  */
-
-  temp = strchr(entry,'=');
-  if ( temp == 0 )
-    return( -1 );
-
-  length = (unsigned) (temp - entry + 1);
-
-
-  /*  Scan through the environment looking for "NAME="  */
-
-  for ( p=environ; *p != 0 ; p++ )
-    if ( strncmp( entry, *p, length ) == 0 )
-      {
-      *p = entry;
-      return( 0 );
-      }
-
-
-  /*  The name was not found, build a bigger environment  */
-
-  size = p - environ;
-
-  new_environ = (char **) malloc( (size+2)*PSIZE );
-
-  if ( new_environ == (char **) NULL )
-    return( -1 );
-
-  memcpy ((char *) new_environ, (char *) environ, size*PSIZE );
-
-  new_environ[size]   = entry;
-  new_environ[size+1] = NULL;
-
-  environ = new_environ;
-
-  return(0);
-}