This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Directory separator patches part 3


> Don't you also need to update cppfiles.c since it groks paths in a manner
> simlar to cccp.

cppfiles.c doesn't use DIR_SEPARATOR, so my search never turned 
up that file. cppinit.c also needed an adjustment.

* gcc/cppinit.c (base_name): Use HAVE_DOS_BASED_FILE_SYSTEM 
in place of __MSDOS__ and _WIN32.
* gcc/cppfiles.c (simplify_pathname): Likewise.

I could have altered simplify_pathname the same way I altered its 
cousin in cccp.c and eliminate the extra for loop for win32 & dos. Jeff, if 
you strongly prefer this, I'll redo the patch to do that.

*** gcc/cppinit.c.orig	Tue Mar 16 13:10:12 1999
--- gcc/cppinit.c	Wed Mar 31 11:29:34 1999
*************** base_name (fname)
*** 434,440 ****
  {
    char *s = (char *)fname;
    char *p;
! #if defined (__MSDOS__) || defined (_WIN32)
    if (ISALPHA (s[0]) && s[1] == ':') s += 2;
    if ((p = rindex (s, '\\'))) s = p + 1;
  #elif defined VMS
--- 434,440 ----
  {
    char *s = (char *)fname;
    char *p;
! #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
    if (ISALPHA (s[0]) && s[1] == ':') s += 2;
    if ((p = rindex (s, '\\'))) s = p + 1;
  #elif defined VMS
*** gcc/cppfiles.c.orig	Fri Mar 19 12:43:44 1999
--- gcc/cppfiles.c	Wed Mar 31 11:28:18 1999
*************** simplify_pathname (path)
*** 1167,1173 ****
      char *base;
      int absolute = 0;
  
! #if defined _WIN32 || defined __MSDOS__
      /* Convert all backslashes to slashes. */
      for (from = path; *from; from++)
  	if (*from == '\\') *from = '/';
--- 1167,1173 ----
      char *base;
      int absolute = 0;
  
! #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
      /* Convert all backslashes to slashes. */
      for (from = path; *from; from++)
  	if (*from == '\\') *from = '/';

--- 
Mark Elbrecht, snowball3@usa.net
http://snowball.digitalspace.net/


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