This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

DOS/Windows-related changes in the libiberty subdirectory


The following changes solve DOS/Windows-related problems in libiberty.

1999-07-30  Eli Zaretskii  <eliz@is.elta.co.il>

	* pexecute.c (pexecute) [__GO32__]: Use P_WAIT instead of literal
	1.  Cast program to "char *", to shut up gcc.
	(pwait) [__DJGPP__]: Return ECHILD if called with a wrong pid.
	Fix the status code to conform to DJGPP's WIF* macros.

1999-07-13  Eli Zaretskii  <eliz@is.elta.co.il>

	* argv.c (BACKSLASH_AS_SLASH) [__MSDOS__ || _WIN32]: Define.
	(buildargv) [BACKSLASH_AS_SLASH]: Backslash is an escape character
	only before a quote character.

*** libiberty/pexecute.c~0	Fri May  1 18:47:52 1998
--- libiberty/pexecute.c	Fri Jul 30 19:12:16 1999
*************** pexecute (program, argv, this_pname, tem
*** 140,146 ****
  
  #ifdef __GO32__
    /* ??? What are the possible return values from spawnv?  */
!   rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (1, program, argv);
  #else
    char *scmd, *rf;
    FILE *argfile;
--- 140,146 ----
  
  #ifdef __GO32__
    /* ??? What are the possible return values from spawnv?  */
!   rc = (flags & PEXECUTE_SEARCH ? spawnvp : spawnv) (P_WAIT, program, argv);
  #else
    char *scmd, *rf;
    FILE *argfile;
*************** pexecute (program, argv, this_pname, tem
*** 187,193 ****
    if (rc == -1)
      {
        *errmsg_fmt = install_error_msg;
!       *errmsg_arg = program;
        return -1;
      }
  
--- 187,193 ----
    if (rc == -1)
      {
        *errmsg_fmt = install_error_msg;
!       *errmsg_arg = (char *)program;
        return -1;
      }
  
*************** pwait (pid, status, flags)
*** 207,219 ****
        /* Called twice for the same child?  */
        || pid == last_reaped)
      {
!       /* ??? ECHILD would be a better choice.  Can we use it here?  */
        errno = EINVAL;
        return -1;
      }
!   /* ??? Here's an opportunity to canonicalize the values in STATUS.
!      Needed?  */
    *status = last_status;
    last_reaped = last_pid;
    return last_pid;
  }
--- 207,227 ----
        /* Called twice for the same child?  */
        || pid == last_reaped)
      {
!       /* ECHILD is a better choice, if we can use it.  */
! #ifdef __DJGPP__
!       errno = ECHILD;
! #else
        errno = EINVAL;
+ #endif
        return -1;
      }
!   /* Here's an opportunity to canonicalize the values in STATUS, if
!      needed.  */
! #ifdef __DJGPP__
!   *status = (last_status >> 8);
! #else
    *status = last_status;
+ #endif
    last_reaped = last_pid;
    return last_pid;
  }
*** libiberty/argv.c1~	Fri May  1 18:47:48 1998
--- libiberty/argv.c	Tue Jul 27 19:15:56 1999
*************** extern char *strdup ();		/* Duplicate a 
*** 55,60 ****
--- 55,64 ----
  
  #endif	/* __STDC__ */
  
+ #if defined(__MSDOS__) || defined(_WIN32)
+ #define BACKSLASH_AS_SLASH
+ #endif
+ 
  #include "alloca-conf.h"
  
  #ifndef NULL
*************** char *input;
*** 277,282 ****
--- 281,290 ----
  		    }
  		  else if (*input == '\\')
  		    {
+ #ifdef BACKSLASH_AS_SLASH
+ 		      /* Don't break dosish file names.  */
+ 		      if (input[1] == '\'' || input[1] == '"')
+ #endif
  		      bsquote = 1;
  		    }
  		  else if (squote)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]